Welcome to Server Circle. It's a friendly site and all levels of experience are welcome. Be aware that we use cookies for your login.
Server Circle - Ask questions about Servers and get answers from experts.
Beta (0.27 sec)
PHP header not working in a script

I'm having to use a meta refresh in a script because the Location header stuff isn't working.

Any ideas ?

Thanks.
Asked by:
Trinity
2782 points
 Report Abuse
 Share Page - Category: Programming - Tags: PHP header not working in a script
 Enter your response
Please use Pastie.org to paste lengthy code or to fix formatting issues with code
  • Responses in reverse (2)

Best Answer

Almost always caused by either:

- Use of include() or require() before the header() call is made.

- Use of something like session_start() before the header.

- Something else echoing.

This is assuming you're getting the "Can not modify headers, sent at line xxxx".

If it's doing something else then we need to know exactly what's going on?

Response by:
trevHCS
640 points
Note the comments about the whitespace and blank lines:

http://www.linuxquestions ...

Response by:
Moocher
625 points


  • Related Questions
About Us : Contact Us : Etiquette : Terms : CDN Failover : ShorterURL : CDN Fallback : © 2013 Server Circle