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 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] 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 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. 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 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" 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 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 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
Archived
This topic is now archived and is closed to further replies.