به مثال زير توجه كنيد :
form.html
کد HTML:
<form action="test.php" method="post">
username : <input type="input" name="username" value="">
<br>
email : <input type="input" name="email" value="">
<input type="submit" name="submit" value="Submit">
</form>
test.php
کد PHP:
<?php
if(empty($_POST['username']) OR empty($_POST['email']))
die('please fill the form !');
echo "You are submitting the fowllowing informations : <br> username = ".$_POST['username']." <br> email = ".$_POST['email'];
?>
<form action="test2.php" method="post">
<input type="hidden" name="username" value="<?php echo $_POST['username'] ?>">
<input type="hidden" name="email" value="<?php echo $_POST['email'] ?>">
<input type="submit" name="submit" value="Verify">
<input type="button" name="back" value="Correct" onclick="document.location='form.html'">
</form>
test2.php
کد PHP:
<?php
//test2.php
if(empty($_POST['username']) OR empty($_POST['email']))
die('please fill the form !');
echo "You have submited the fowllowing informations : <br> username = ".$_POST['username']." <br> email = ".$_POST['email'];
?>