Or you can keep posting the data back to the same fields. Make your life easier by setting up a generic function you can just add a list of fields to like
<?php
$formFields = array('name', 'email', 'password', 'somethingelse');
$fdata = get_input($formFields, true);
?>
YOU FORM GOES HERE with stuff like
<form>
<input type="text" name="name" value="<?php echo $fdata['name']; ?>">
<input type="text" name="email" value="<?php echo $fdata['email']; ?>">
<input type="text" name="password" value="<?php echo $fdata['password']; ?>">
</form>
<?php
/* returns an array of required fields - empty if they're not supplied */
function get_data($fields, $useSpecialChars = false)
{
$data = array(); // it'll be returned
foreach ($fields as $field)
{
if (isset($_POST[$field]))
{
$data[$field] = trim($_POST[$field]);
if (get_magic_quotes_gpc())
$data[$field] = stripslashes($data[$field]);
// it's ready to go straight back into forms if you specify true for 2nd char
if ($useSpecialChars)
$data[$field] = htmlspecialchars($data[$field]);
}
else
{
$data[$field] = '';
}
}
return $data;
}
?>
Since Firefox does its one session for every damn window I've had to convert a lot of code where you might have 10 windows open at once to use this system, as you might start a post in one, then another, save in the first and get the input from the other. It's not that much of a gip, just something to lookout for.