Guardian-Mage Posted May 11, 2008 Share Posted May 11, 2008 I have one page. It says session_start(); $_SESSION['limit] = $limit; echo $_SESSION['limit'] //Will write out 50 The page than submits a form with post data to another page session_start(); $limit = $_SESSION['limit']; echo $limit //Will write out "Array" Why isn't my second page printing out 50? I am using PHP 4.4.2 and Apache 1.3.36. It works fine With PHP 5.2.6 and Apache 2.2.8 Quote Link to comment https://forums.phpfreaks.com/topic/105166-solved-data-disappearing-in-my-sessions/ Share on other sites More sharing options...
bilis_money Posted May 11, 2008 Share Posted May 11, 2008 [qoute] session_start(); $_SESSION['limit] = $limit; echo $_SESSION['limit'] //Will write out 50 [/qoute] Missing qoute? --> ['limit] Quote Link to comment https://forums.phpfreaks.com/topic/105166-solved-data-disappearing-in-my-sessions/#findComment-538446 Share on other sites More sharing options...
Guardian-Mage Posted May 11, 2008 Author Share Posted May 11, 2008 No, that was an error when I retyped it here. The host is threeton.com by the way Quote Link to comment https://forums.phpfreaks.com/topic/105166-solved-data-disappearing-in-my-sessions/#findComment-538458 Share on other sites More sharing options...
bilis_money Posted May 11, 2008 Share Posted May 11, 2008 Try this. first page. <?php session_start(); $limit = 50; $_SESSION['limit'] = $limit; echo $_SESSION['limit']; //Will write out 50 ?> 2nd page. <?php session_start(); $limit = $_SESSION['limit']; echo $limit; //Will write out "Array" ?> these code are tested. Quote Link to comment https://forums.phpfreaks.com/topic/105166-solved-data-disappearing-in-my-sessions/#findComment-538462 Share on other sites More sharing options...
Guardian-Mage Posted May 11, 2008 Author Share Posted May 11, 2008 same result Quote Link to comment https://forums.phpfreaks.com/topic/105166-solved-data-disappearing-in-my-sessions/#findComment-538482 Share on other sites More sharing options...
wildteen88 Posted May 11, 2008 Share Posted May 11, 2008 Do you have anther variable called limit in your code or perhaps a form field called limit which is any array and does your have have register_globals enabled echoing $_SESSION['limit'] or $limit in your second page should not return "array" Quote Link to comment https://forums.phpfreaks.com/topic/105166-solved-data-disappearing-in-my-sessions/#findComment-538488 Share on other sites More sharing options...
bilis_money Posted May 11, 2008 Share Posted May 11, 2008 try echo phpinfo(); and check the settings. or you can enable register_global if it were turned off using .htaccess Quote Link to comment https://forums.phpfreaks.com/topic/105166-solved-data-disappearing-in-my-sessions/#findComment-538490 Share on other sites More sharing options...
Guardian-Mage Posted May 11, 2008 Author Share Posted May 11, 2008 Yes, I had variables with the same name as my session variables. All fixed up now, thanks Quote Link to comment https://forums.phpfreaks.com/topic/105166-solved-data-disappearing-in-my-sessions/#findComment-538507 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.