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!

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?

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.