Jump to content

[SOLVED] session variables get lost on refresh


xiao

Recommended Posts

if(($_POST['processor'] != "(Make a choice)") && ($_SESSION['processor'] != $_POST['processor'])){
$_SESSION['processor'] = $_POST['processor'];
}

 

So it shouldn't overwrite everytime, right?

It does though.

 

i have a session_start(); (tried to remove it and got quite some errors)

I don't have a session_destroy anywhere.

 

I don't really get it...

if(($_POST['processor'] != "(Make a choice)") && ($_SESSION['processor'] != $_POST['processor'])){
$_SESSION['processor'] = $_POST['processor'];
}

 

So it shouldn't overwrite everytime, right?

It does though.

 

i have a session_start(); (tried to remove it and got quite some errors)

I don't have a session_destroy anywhere.

 

I don't really get it...

 

Yeah, because when you have a blank $_POST, $_POST['processor'] isn't "(Make a choice)", it's NULL.  Get it?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.