hi guys, i got a question.
i got a submit page for users details and i can post that to the next page that has all the users mistakes on it - proccess.php - for example "you havent filled blank out correctly go back and fill out again" now my question is how would i go about going back to the submit form with the details STILL in there?
any help what so ever would be great! is this the best way to do it?
thanx
form processing question
Moderator: General Moderators
Why not keeping it on the same page
Code: Select all
#with $_SERVER['PHP_SELF']
#example
if(isset($_POST['submit']))
{
if(strlen($_POST['some'])>0)
{
$some ='1';
}
else
{
$some = '* You forgot Something';
}
#than youre form would look like this
if($some == '1')
{
echo '<font size="2">Some<input type="text" name="'.$_POST['some'].'">';
}
else{ echo '<font size="2">Some<input type="text" name="some">'.$some.'';
}-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
You can as long as you echo it back as the forms values of keep it in hidden fields. I always post my forms, check that everything is ok and if it isnt show an error message that has all the data hidden in a form on that error page. Then the user clicks a button to go back to the first form where the data they entered to begin with is placed into the form as the default field values.
Once you code this up into OO its very simple, and you dotn have to keep typing out the hidden forms and stuff.
Once you code this up into OO its very simple, and you dotn have to keep typing out the hidden forms and stuff.