Jump to content

session not working


xiao

Recommended Posts

session_start();

I don't have a session_destroy();

And if I echo session_id(); it works :-S

 

Only my variables don't get filled

 

Tell me the output of this:

$_SESSION['processorfabrikant'] = $_POST['processorfabrikant'];
print_r ($_SESSION);
echo "<hr>";
print_r ($_POST);

Link to comment
https://forums.phpfreaks.com/topic/102403-session-not-working/#findComment-524368
Share on other sites

Array ( [processorfabrikant] => Intel [qryProcessor] => 0 [processor] => [productid] => Array ( [processor] => [moederbord] => [graka] => [behuizing] => ) [prijs] => Array ( [processor] => [moederbord] => [graka] => [behuizing] => ) [moederbordfabrikant] => [qryMoederbord] => 0 [moederbord] => [grakatype] => [grakaCat] => 185 [qryGrakaFabrikanten] => 0 [qryGraka] => 0 [graka] => [behuizingprijs] => [qryBehuizing] => 0 [behuizing] => )

___________________________________________________________________________________________________

Array ( [behuizingprijs] => (Maak een keuze) [processorfabrikant] => Intel [processor] => 1548 - HPHIA1 - 145,20 - Intel® Xeon® 3065 (Boxed, FC-LGA4, [productcodeEC] => )

Link to comment
https://forums.phpfreaks.com/topic/102403-session-not-working/#findComment-524373
Share on other sites

According to that it should be working right?

But that's weird, because I use it like this:

if(($_POST['processor'] != "(Maak een keuze)") && ($_SESSION['processor'] != $_POST['processor'])){
$_SESSION['processor'] = $_POST['processor'];
print_r ($_SESSION);
echo "<hr>";
print_r ($_POST);
splits($_SESSION["processor"], "processor");
}

 

So the SESSION var only changes when the POST var changes.

So the print_r should only work the first time I submit the form (as long as I don't alter POST['processor']) right?

Because it prints it everytime I submit.

Link to comment
https://forums.phpfreaks.com/topic/102403-session-not-working/#findComment-524389
Share on other sites

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.