xiao Posted April 22, 2008 Share Posted April 22, 2008 for some reason my session variables aren't working. I use $_SESSION['processorfabrikant'] = $_POST['processorfabrikant']; and I have a session_start; What can I be doing wrong? ??? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 22, 2008 Share Posted April 22, 2008 Do you have session_start(); or session_start;? Quote Link to comment Share on other sites More sharing options...
xiao Posted April 22, 2008 Author Share Posted April 22, 2008 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 Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 22, 2008 Share Posted April 22, 2008 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); Quote Link to comment Share on other sites More sharing options...
xiao Posted April 22, 2008 Author Share Posted April 22, 2008 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] => ) Quote Link to comment Share on other sites More sharing options...
xiao Posted April 22, 2008 Author Share Posted April 22, 2008 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.