Jump to content

using digest string as identifier of visitor from an email link


ajetrumpet

Recommended Posts

Hi all,

 

I have a unique request from someone that uses unorthodox methods for emailing campaigns in his business.  Currently he is using the SendGrid service to send unlimited relays throughout the country.  What he's not capable of though is being able to script some PHP such that he can use an identifier (either incrementally or from an algorithmic digest from PHP) in the actual URL to send the user to the page....

 

(e.g. => mysite.com/brochurepage.php?u=384954)

 

but before rendering the information on the page, redirect the user again to the proper page such as....

 

(e.g. => mysite.com/brochurepage.php)

 

The desire here is to have PHP read a MYSQL database and compare the q string identifier with the proper record to get the name and phone number of the user that is already stored in the same database.

 

I realize this is odd and certainly not the easiest way to do something like this.  Does anyone have any hints for me on how to make this easy?  The only thing I can think of that compares to this effort is when forums send algorithmic digests to the email that was registered by the user.  And I'm guessing at that point the PHP script verifies the human authenticity of the email click due to the digest match that is found in the database.

 

Am I correct here?  Looking for the PHP experts here to guide me in the right direction.  thanks so much guys!

Link to comment
Share on other sites

 

Are you keeping a unique ID column along with the name/phone numbers?

 

yes of course.  the only 2 issues I see here is the fact that I don't know how to extract the query string out of the URL with PHP in order to use that and make the comparison.

 

that, and of course getting the user (clicker) to the appropriate page so it doesn't error out.  wouldn't it?  I would think so, as the URL would not be the same at all.  actually, the URL minus the query string would be the target page.

 

thanks!

Link to comment
Share on other sites

page.php?u=1234

 

In page.php - $_GET['u'] will contain the string '1234'

 

$query = 'SELECT name, phone_number FROM people WHERE id = '.(int)$_GET['u'];

 

That might help to get you started.

 

The page will load the same, unless the query string actually changes the way the page should display.

 

The query string is independent of the request. It will only affect how the page displays if the page itself is programmed to allow it to.

http://www.phpfreaks.com/

http://www.phpfreaks.com/?abc=123

Link to comment
Share on other sites

hi xyph,

 

Hey I got it to work.  that will be fine for what we're doing.  Do you perhaps know if there is a cap on the concurrent connections to a mysql database when using PHP?  as in, if the page is loaded 10 times by 10 different people at the same moment, will PHP simply execute the connection requests concurrently and the subsequent queries as well??  Or will it act kind of like threading in an operating system where memory processes changes statuses to "wait" and "execute" depending on their place in line (as the processor sees it)??

 

thanks so much!!

Link to comment
Share on other sites

Unless you're using persistent connections, which you probably aren't if you don't know what I'm talking about, then you don't need to worry about the number of concurrent database connections. By the time you need to worry about that, you'll have a lot of users on your site. And I mean a lot.

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.