Jump to content


Handling Errors on 1 form, posting them to another?

  • Please log in to reply
No replies to this topic

#1 mjcunnin

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 19 April 2006 - 09:13 PM

Basically what I have to do is an exercise on how to pass data between multiple forms using hidden variables. After the data is entered and you submit it, it sends everything to the second form, where I have the validation taking place. Then the error messages from the last page are posted to this page. I was wondering, is there a way or a function that lets you go back to the previous page and print the error messages there without having to use the "back" key on ur browser?

This is the validation I have on the 2nd page. Thanks for any and all help!

$name = $_POST['name'];
$age = $_POST['age'];

if(strlen($_POST['name']) > 0){
$name = TRUE;
$name = FALSE;
$message1 .= '<p>Please enter your name!</p>';
$age = TRUE;
$age = FALSE;
$message1 .= '<p>Please enter your age!</p>';
if(isset ($message1)){
echo '<font color="red">', $message1,'</font>';
if($name && $age){

$name = $_POST['name'];
$age = $_POST['age'];

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users