Passing variables through a link in an email to a form

Antonio Barrera

I made a survey about the service of a hotel and people has to put their name, last name, email and phone number after answering the questions. When you press the submit button the answers and the personal info is saved in a DB and then and email is sent to the client. The email has a link to a registration form to receive promotions and other stuff. Now here is the question: Can I send the name, last name, email and phone number from the survey through these link and put that information into an specific field in the registration form? (The owner of the hotel doesn't want people fill this information again) Both survey and registration form use method post for the submit. I want to know if it is posible to do this. I'm using php to do all this stuff by the way.

Chipster

Yes. You can use PHP's GET.

To use, access a url like so:

myPage.php?name=JohnDoe&email=jdoeatexampledotcom&morevars=morevalues
// etc.

Note: There should be a proper way to escapre the @ and ., but I don't know how off the top of my head. Anyway, from PHP you can access it like this:

<?php
echo $_GET["name"] . "<BR>\n";
echo $_GET["email"] . "<BR>\n";
echo $_GET["morevars"] . "<BR>\n";
// etc...
?>

This will output:

JohnDoe
jdoeatexampledotcom
morevalues

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related