I've been busy coding a signup system with PHP.
There are 2 forms , form1 and form2.
form1 contains:
Name , Age ,
form 2 contains
Username , Password , Repeat Pass , Email
I use POST method to submit the form.
Here , name and age is sent from form1 to form2 and form2 gets it through $_POST vars. The next step is submitform.php , once form2 gets form1 data with $_POST , it submits its data (Username,Pass..) with form1 data as a
<input type="hidden"> field.
Ex.
Form2 :[php]
<form method="POST" action="submitform.php">
<input type="text" name="username"/>
<input type="password" name="password"/>
<input type="pass2" name="repeatpass"/>
<input type="email" name="email"/>
<input type="hidden" name="name" value="<? echo $_POST['name'];?>"/>
<input type="hidden" name="age" value="<? echo $_POST['age'];?>"/>
<input type="submit" name="sub" value="submit">
</form>[/php]Everything works fine but the prob am facing is , invalid data.
Everything that was submitted gets sent correctly.
But many times , I get name=ssss and age=32 in the submitform.php even though I had my name as "gamer" and age as "20" , once I go back and resubmit , it comes fine but again at times , I get the data "ssss" and "32" even when it wasnt submitted. I use Opera 9.26.
Why does this happen ? How do I avoid it?
Please help me.
Thanks.