Jump to content

Generate a unique URL for each new email that expires after a given time


frshjb373

Recommended Posts

I'm not sure I'm in the right place, but I'm looking to create a unique URL that links to the same page every time I send an email after a form is submitted on my website and have it expire after 15 days.  After expiring, the link would redirect to a default page.  I'm still a beginner and realize this is probably going to be a tough task, but any resources or direction provided would be much appreciated.

 

Thanks for the help in advance!

Link to comment
Share on other sites

Let's take this step by step. First, we have to create a unique link. The easiest way to do this is through the query string! For example..

 

script.php?token=ABC123

 

Within script.php, 'ABC123' would be stored in the array $_GET['token']. You can use multiple variables in the query string, delimited by the '&' symbol.

 

script.php?token=ABC123&foo=bar

 

Within script.php, echo $_GET['token'] would output 'ABC123', and echo $_GET['foo'] would output 'bar'

 

Follow me so far? Am I going too fast? Too slow?

Link to comment
Share on other sites

similar advice - in the email get them to click on the link script.php?token={date_form_submitted_in_some_format_maybe_a_number}

 

then in script.php get the date in token and subtract it from today

and find out how many days have passed and depending on whether

this is over or under 15 days, then direct accordingly.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.