How do I pass values with a link into mySQL database using PHP?

  • Thread starter Thread starter Melissa M
  • Start date Start date
M

Melissa M

Guest
I have designed a survey with PHP that submits the responses into a MySQL database. The people that will be taking the survey are existing clients which have user IDs and information stored in a database that I do not have direct access to.

What I would like to do is send each client an email with a link that sends their id number with their survey responses.

I have two variables that I need to pass with the link: center and custID - I was planning on doing it like so...
.../pre_venture.php?center=10&custID=12345

When they click the link, I need the values passed with the survey responses. I have two files pre_venture.php and presurvey.php... pre_venture is the actual survey and presurvey is what sends the information into the database.

In the presurvey.php file, I use post to send the information to the database like so...

$sql="INSERT INTO pre_vent (center, custID, yStart, yAcquired, yOther, comments)
VALUES
('$_POST
','$_POST[custID]','$_POST[yStart]','$_POST[yAcquired]','$_POST[yOther]','$_POST[comments]')";

When I test the survey, the values for center and custID are not sent. Please help!​
 
Back
Top