how to reload form contents

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chitrapu
Forum Newbie
Posts: 23
Joined: Sun Jan 14, 2007 11:39 pm

how to reload form contents

Post 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?: :?: :? :? :? :? :? :? :?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

post the code you're trying to use
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post 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();
Post Reply