I want to retrieve some values from my url and post them in a form.
For example:
url = hello.com/hello.php?id=3
My Form:
Id = 3
What code do I need to access the value for id? Some kind of post? Or get? Or script?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Any values appended to the end of a URL will be available in a PHP script via the $_GET global variable. So in your case you can retrieve the ID in php by doing:
$_GET['id']Variables submitted via a form whose method = ‘post’ are available through the $_POST variable.
If you want to put that data in a form field do:
although your probably don’t want to just stick $_GET[‘id’] in as a value without checking / sanitizing it first.
http://www.cgisecurity.com/xss-faq.html