iThaos Posted March 9, 2009 Share Posted March 9, 2009 Is there a problem with PHP sessions on this host? I get this when trying to use sessions: Warning: session_start() [function.session-start]: Cannot send session cache limiter Quote Link to comment Share on other sites More sharing options...
Byron Posted March 9, 2009 Share Posted March 9, 2009 PHP Sessions seems to be working fine for me. Check your script for errors. http://byrondallas.heliohost.org/php/tools...annotator-s.php http://byrondallas.heliohost.org/php/tools...annotator-s.txt Try this simple piece of code and see if it returns a sessions number for you: <?php session_start(); echo session_id(); ?> Quote Link to comment Share on other sites More sharing options...
iThaos Posted March 10, 2009 Author Share Posted March 10, 2009 My script definitely works. It works fine on localhost and on other hosts. Now that I removed the sessions, it's still like this. Compare => http://cardthrower.heliohost.org/index.php ===> Heliohost =======> http://www.examshared.com ============> Proper They both use the same scripts. Thanks Quote Link to comment Share on other sites More sharing options...
software advisor henry Posted March 10, 2009 Share Posted March 10, 2009 1. heliohost uses php5 so register_globals is disabled. Declare all your globals in functions if you need to use them. [global $variablename;] 2. The header is already sent because a mysql_error has been issued and so the session cannot start. You must fix mysql before you can use sessions. 3. mysql_numrows is an old function. Use mysql_num_rows instead. For better performance if you just want the row no.s and not the actual query result, use [ $query=mysql_query("Select count(*) from tablename where field = 'condition'") echo mysql_fetch_array($query); ] Quote Link to comment Share on other sites More sharing options...
iThaos Posted March 11, 2009 Author Share Posted March 11, 2009 1. heliohost uses php5 so register_globals is disabled. Declare all your globals in functions if you need to use them. [global $variablename;] 2. The header is already sent because a mysql_error has been issued and so the session cannot start. You must fix mysql before you can use sessions. 3. mysql_numrows is an old function. Use mysql_num_rows instead. For better performance if you just want the row no.s and not the actual query result, use [ $query=mysql_query("Select count(*) from tablename where field = 'condition'") echo mysql_fetch_array($query); ] Ok Thanks! I'll make those changes soon. Thanks for your help! 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.