php - header() function not working after $_SESSION -


i have big issue , can't solve it. made simple login script , worked on laptop's lamp server. happy , uploaded host, there couldn't log in. solved header() not working after $_session. current test code without login , everything:

 <?php  session_start();  $_session['test'] = 10;  header("location: anything.php");  ?> 

and doesn't redirect. problem?

the problem headers have been send. is, session_start sends out several http headers. http://php.net/manual/en/function.session-start.php:

this function sends out several http headers depending on configuration. see session_cache_limiter() customize these headers.

try turning warnings , errors on (this should give warning) error_reporting(-1);. doing during development practice anyway.

if it's not that, must sending output before header. although, looking @ example code gave, that's not case.

see this nicely answered question more information problem.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -