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? ??? Link to comment https://forums.phpfreaks.com/topic/102403-session-not-working/ 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;? Link to comment https://forums.phpfreaks.com/topic/102403-session-not-working/#findComment-524355 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 Link to comment https://forums.phpfreaks.com/topic/102403-session-not-working/#findComment-524365 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); Link to comment https://forums.phpfreaks.com/topic/102403-session-not-working/#findComment-524368 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] => ) Link to comment https://forums.phpfreaks.com/topic/102403-session-not-working/#findComment-524373 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. Link to comment https://forums.phpfreaks.com/topic/102403-session-not-working/#findComment-524389 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.