I can't use header()
in any page where the session_start()
is running. When I use it it says
Can't modify header information already sent by (...)
Can anyone help me for this issue?
I can't use header()
in any page where the session_start()
is running. When I use it it says
Can't modify header information already sent by (...)
Can anyone help me for this issue?
you're printing something to the http stream before you call header. You can't do this you need to call header before any printing/echoing is done.
You may be getting a warning from your session_start if that's the only thing in your code, try and suppress warnings so it does not show anything else besides code output:
error_reporting(E_ERROR | E_PARSE);
Otherwise just do as others have said and make sure your code isn't outputting anything before the header is changed.