i have set register_globals to 'On' so i can acces all variables that were created in previous form in the current page but i cannot access any variable that was created beore the previous form i mean that was created before last page. right wt i m doin is i m creating a hidden type in each page and giving previous value as its current value and then using the hidden variable in next page.
wat i know is there exists some array but i dont know wat exactly that is..
can anybody tell me..
how can i acces variables of 2nd last form
Moderator: General Moderators
-
bugthefixer
- Forum Contributor
- Posts: 118
- Joined: Mon Mar 22, 2004 2:35 am
No need to turn register_globals On...
Say if you had a form like this:-
And in the next page...
And in the next:-
Although I would validate the sent data for any hacking attempts... just in case!
Say if you had a form like this:-
Code: Select all
<form method="POST" action="next.php">
<input name="field1" id="field1" value="" type="text">
<input value="submit" type="submit">
</form>Code: Select all
<form method="POST" action="next2.php">
<input name="field2" id="field2" value="" type="text">
<input name="field1" id="field1" value="<?php echo $_POST['field1'] ?>" type="hidden">
<input value="submit" type="submit">
</form>Code: Select all
<form method="POST" action="next3.php">
<input name="field3" id="field3" value="" type="text">
<input name="field2" id="field2" value="<?php echo $_POST['field2']; ?>" type="hidden">
<input name="field1" id="field1" value="<?php echo $_POST['field1']; ?>" type="hidden">
<input value="submit" type="submit">
</form>