Problem with $_SESSION

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dogsface
Forum Newbie
Posts: 2
Joined: Tue Sep 26, 2006 3:47 pm

Problem with $_SESSION

Post by dogsface »

I have a form named: form1, with 2 fields, Name and Last Name, form1 starts with a session ID: session_start();

When I click SUBMIT in the form1, it's going to form2.

I have a check for error in form2, if the user forgot to enter Name or Last Name, it will trow and error warning, and I hava a button were the user can click to go back to form1 to corrct any mistake, that button is like this:
$error = "
You forgot to fill out the form! Try again. Thank you.
<input type=\"submit\" value=\"Go back\" onClick=history.go(-1);>
";

The problem I am having, is that when I click the button, IE trows an error page and I cant see the form1 and I need to refresh the page in order to see form1, there is no way I cant go directly from the button. I tryied in firefox and when I click in the button, firefox gives me a javascript pop menu with the following:

"The page you are trying to view contains POSTDATA that has expired from cache. If you resend the data, any action the form carried out (such as a search or online purchase will be repeated. To resent the data click OK, otherwise click cancel."

and it allow me to go to the form1.

Please can anyone help out here?? What am I missing or doing wrong??

Thank you.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

try

Code: Select all

session_cache_limiter('private_no_expire');
session_start();
see http://de3.php.net/function.session-cache-limiter
dogsface
Forum Newbie
Posts: 2
Joined: Tue Sep 26, 2006 3:47 pm

thanks, that worked!!!!

Post by dogsface »

hey thank you very much, I was reading about this on php.nt, and that help me to fix the problem.!!!

1 million thanks!

doggy
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

dogsface wrote:I was reading about this on php.nt, and that help me to fix the problem.!!!
What more could i ask for? Image
Post Reply