mjcunnin Posted April 19, 2006 Share Posted April 19, 2006 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!<?php$name = $_POST['name'];$age = $_POST['age'];if(strlen($_POST['name']) > 0){ $name = TRUE; }else{ $name = FALSE; $message1 .= '<p>Please enter your name!</p>'; }if(is_numeric($_POST['age'])){ $age = TRUE; }else{ $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'];}else{ Quote Link to comment https://forums.phpfreaks.com/topic/7889-handling-errors-on-1-form-posting-them-to-another/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.