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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.