i wanna keep last value of input box after submit and this is my code .
but my code dosent work
<input type="text" name="name" value="<?php echo $_GET['name'];?>" />
should i use javascript or php ?
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.
I think that your question “should i use javascript or php ?” doesn’t mean:
My answer should be: no, the browser could have not the javascript.
But I think that your question is:
why my post submit values are not present into the global macro $_GET?
Of course you can use the $_POST[‘name’]; entity to show the value, but this is a really bad choice:
so you may do something like this:
inside the PHP
$valid = validate( $_POST );
inside the HTML
<input type=”text” name=”name” value=”<?php echo $valid[‘name’];?>” />