ajetrumpet Posted August 16, 2012 Share Posted August 16, 2012 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! Quote Link to comment https://forums.phpfreaks.com/topic/267192-using-digest-string-as-identifier-of-visitor-from-an-email-link/ Share on other sites More sharing options...
xyph Posted August 16, 2012 Share Posted August 16, 2012 This is pretty standard for tracking. Are you keeping a unique ID column along with the name/phone numbers? If not, that's your first step. Quote Link to comment https://forums.phpfreaks.com/topic/267192-using-digest-string-as-identifier-of-visitor-from-an-email-link/#findComment-1369992 Share on other sites More sharing options...
ajetrumpet Posted August 16, 2012 Author Share Posted August 16, 2012 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! Quote Link to comment https://forums.phpfreaks.com/topic/267192-using-digest-string-as-identifier-of-visitor-from-an-email-link/#findComment-1369996 Share on other sites More sharing options...
xyph Posted August 16, 2012 Share Posted August 16, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/267192-using-digest-string-as-identifier-of-visitor-from-an-email-link/#findComment-1369997 Share on other sites More sharing options...
ajetrumpet Posted August 18, 2012 Author Share Posted August 18, 2012 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!! Quote Link to comment https://forums.phpfreaks.com/topic/267192-using-digest-string-as-identifier-of-visitor-from-an-email-link/#findComment-1370543 Share on other sites More sharing options...
Christian F. Posted August 19, 2012 Share Posted August 19, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/267192-using-digest-string-as-identifier-of-visitor-from-an-email-link/#findComment-1370567 Share on other sites More sharing options...
ajetrumpet Posted August 19, 2012 Author Share Posted August 19, 2012 sounds good. that's what I figured. I know these engines are already suited for this purpose, but doesn't hurt to ask! thanks! Quote Link to comment https://forums.phpfreaks.com/topic/267192-using-digest-string-as-identifier-of-visitor-from-an-email-link/#findComment-1370584 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.