Jump to content

Who Is This ?


GregoireLeGros

Recommended Posts

I am creating a survey page on my website. It will collect data about all of my contacts. I will send an email to each of my contacts containing a link to my survey page eg http://www.mywebsite.com\mysurveypage so that they can submit their details. The data is sent back to me so I can update my database.I have a database with a record for each of my contacts, with a unique id for each contact. eg John Smith, 01Ann Ford, 02Peter Piper, 03etcWhen I send a mail to Ann Ford I want to put this link in the message eg http://www.mywebsite.com\mysurveypage_02 so that when her data is entered on my surveypage then the php script knows that the data belongs to Ann Ford ,02So the question is, can php find this 02 parameter from the session and use it in the script ? Or is there any other way of knowing the id of the user ?Any help will be appreciated.

Link to comment
Share on other sites

You could get the number from the URL, but the problem is that any person could go to your site and pretend to be somebody else.The easiest way to extract data from a URL is with PHP $_GET

Link to comment
Share on other sites

The best way to verify a user is to have a one-off code that is appended to the URL they click on, e.g. http://www.mywebsite.com/mysurveypage?id=d...89q34hgw3489ghh, which is then checked against their entry in the database, which you would have updated at the same time your sent the email. Once they vote, you can delete the ID from the database so they can't vote again.

Link to comment
Share on other sites

The best way to verify a user is to have a one-off code that is appended to the URL they click on, e.g. http://www.mywebsite.com/mysurveypage?id=d...89q34hgw3489ghh, which is then checked against their entry in the database, which you would have updated at the same time your sent the email. Once they vote, you can delete the ID from the database so they can't vote again.
I looked at the get$ method as suggested by DuotoneFox and it is exactly what I need. Thanks for your interest.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...