I am working on php form submit, and i have php validation for form.
The registration page name say “page1.php” and retrieving field values in other page say “page2.php”. if validation throughs error. it will redirect to other page say “page3.php” on click of any link in “page3.php” it will redirect back to registraion page i.e “page1.php” but i am not able to store or retain values entered by user. can any one suggest or guide me how to over come this,
below is the code i used.
Page2.php
$name = $_POST['txtname'];
$_SESSION['txtname'] = $name;
page1.php
<input type='text' name="txtname" id="txtname" value="<?php echo $_SESSION['txtname']; ?>"/>
This should do it, because the
session_start()should be in any php file you execute and want to accessSESSIONarray