Here's the link to my homework
http://www.webdeveloperny.com/form.phpThe First Name field has this code <input name="first_name" type="text" value="Mary" size="40" id="first_name">
The Last Name field has this code <input name="last_name" type="text" value="<?php echo $last_name ?>" size="40">
Notice the first name value "Mary". That value sticks everytime you change the name and hit submit but it prints that submitted name on top of the page.
if I change the code to <?php echo $first_name ?> Mary disappears and sticks whatever name I enter. What I want to accomplish is keeping the name Mary when the page loads and stick whatever name the user types after hitting the submit button. How should I code this? I'm a newbie.
Second, how do I do this on the radio buttons and check boxes as well?
Thanks in advance.
QUOTE(mocker @ 14 Mar, 2008 - 10:57 PM)

There is a big difference between refreshing a page, and submitting the form. If a user goes to hit the refresh button, it does not pass any data to your script, so you cannot see what they had typed in. If they submit it, then the form value for 'first_name' will go in $_POST['first_name'], so
<input name="first_name" type="text" id="first_name" value="<?php echo $_POST['first_name'] ?>" /> would correctly populate that field.
If you are using $first_name as the variable without putting $first_name = $_POST['first_name']; first, then you are using an obselete setting in php called register_globals, which is being completely phased out so you should avoid doing it that way.