Page 1 of 1

how to reload form contents

Posted: Tue Feb 20, 2007 2:19 am
by chitrapu
hi everybody,
I have a form that has several textfields. When i click a button the form gets submitted and a new page opens. When i get back to the main page i need to populate the textboxes automatically with the data that has initially been entered. But that is not hapening. When i am going to the main page all the text boxes are getting cleared. Can you solve my problem please?: :?: :? :? :? :? :? :? :?

Posted: Tue Feb 20, 2007 3:16 am
by Kieran Huggins
post the code you're trying to use

Posted: Tue Feb 20, 2007 4:49 am
by Rovas
Use sessions or a cookie to save the data put in by the user and then just echo the data you saved.

Code: Select all

session_start();
$_SESSION["name"]=$_POST["nameUser"];
//check to see if $_POST["nameUser"] is null
echo "<input type='text' name='nameUser' value=" .$_SESSION["name"] ." />";
// the rest of the data is the same don' t worry about select or options
session_unset();