I just finished an email sending form that will check email, correct imput fields and what not, now when i check for some of these things i redirect people after giving them a warning using javascript, but now ned a way to preserve the input the users have put in.
For this scenario sessions (i dunno u tell me) is not useful because the security level is low and it wouldn't matter here all sensible information is witheld by my php. I was thinking of using hidden fields but they are not "quite" hidden as you can see them in the source, not that i care or anything, but is that common? to store form variables in the hidden input?
How long do the $_POST variables live? i mean they are passed when the form action'' is specified, but do they die if you click another link, or for that same reason are redirected?
Suggestions...
Moderator: General Moderators
To better protray what is going on...
Where would the form go, and how would i assure that the form will actually pass the values since i am not clicking on submit, and does the action="" part of the form actually do anything since the page will redirect anyways?
oh and yes, i know that is not 5 seconds
Code: Select all
$output = ' <BODY onLoad=window.setTimeout("location.href=''email.php?action=missingentry''",5000)>
<B>You have <b>not</b> filled in all the fields<B>
<BR><BR>
<small><b>Note:</b>This window will redirect in 5 seconds<BR><BR>
To go back and fix your entries <a href="email.php?action=missingentry">click here</a></small>
</BODY>';oh and yes, i know that is not 5 seconds
Last edited by mikusan on Fri May 23, 2003 6:32 am, edited 1 time in total.
to pass variables from page to page then you should use session.
e.g.
refer to the manual for more...
good luck!
e.g.
Code: Select all
<?php
session_start();
$_SESSION['var'] = $var;
?>good luck!
hmm i already have sessions running for my site, mainly for people that log in, but i am not sure i need to start a sessions for a small thing like this one, besides it is't designed for logged in users. maybe i am getting ahead of myself, shoud i really use sessions?
i was hoping not to use sessions in this case for once because i am using a javascript redirect and that will cause problems with outputting header info with sessions...
i was hoping not to use sessions in this case for once because i am using a javascript redirect and that will cause problems with outputting header info with sessions...