NickG21 Posted January 8, 2007 Share Posted January 8, 2007 hey everyone i am currently using 6 individual forms in order to gather information from a user. all of the forms have different field names and submit button names. i am looking to use a seperate validation page to validate each one individually and if errors occur to reload the page and keep the correct info displayed. I am able to keep the correct information displayed but i do not know how to make my code have the same page reload. below is my logic of these forms. hope someone can help me out a littlethank you[code]<?php session_start(); header("Cache-control: private"); foreach($_POST as $key => $var) { $_SESSION[$key] = $var; } ?> <?php IF (!isset($_POST['step'])) { include "ListInfo.php"; include "validation.php";} <-- want to include in every page possibly? ELSEIF ($_POST['step'] == 2){ include "OptServices.php";} ELSEIF ($_POST['step'] == 3){ include "ContInfo.php";} ELSEIF ($_POST['step'] == 4){ include "BillInfo.php";} ELSEIF ($_POST['step'] == 5){ include "Survey.php";} ELSEIF ($_POST['step'] == 6){ include "Terms.php";} ?>[/code]and here is some of the validation.php:[code]if(empty($SendAddr)){ $error[] = ""; $SendAddr=""; } if(count($error) > 0){ echo "Please Correct Your Errors Before Proceeding"; }ELSE{ include_once("HeaderImage.php"); }[/code]everything is declared properly above and the validation is all correct this is just where i think i would need to execute the code to return me properly to headerImage.php with the page included depending upon the 'step'? hope this isn't too confusing Quote Link to comment https://forums.phpfreaks.com/topic/33371-sending-info-back-to-a-form/ Share on other sites More sharing options...
magic2goodil Posted January 8, 2007 Share Posted January 8, 2007 [code]header('Location: headerImage.php');[/code] Quote Link to comment https://forums.phpfreaks.com/topic/33371-sending-info-back-to-a-form/#findComment-155933 Share on other sites More sharing options...
NickG21 Posted January 8, 2007 Author Share Posted January 8, 2007 would that reload the initial page, while at the same time echoing "Please Fix Errors Before Proceeding on top?" or will it just send me back to the original headerImage.php? Quote Link to comment https://forums.phpfreaks.com/topic/33371-sending-info-back-to-a-form/#findComment-155940 Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 Did you look up the function before asking that question?You'll need to save your error message to the session. Quote Link to comment https://forums.phpfreaks.com/topic/33371-sending-info-back-to-a-form/#findComment-155942 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.