-2

I tried use Header function, but i get a error: 'Warning: Cannot modify header information - headers already sent by'.

How to make a redirect?

Thanks in advance.

John Conde
  • 217,595
  • 99
  • 455
  • 496
10minutee
  • 219
  • 1
  • 2
  • 5

2 Answers2

0

headers can not be sent if something was ecohed to the browser. please make sure that your script does not print spaces or line breaks outside the tags

sd1sd1
  • 1,028
  • 3
  • 15
  • 28
  • Basically make sure, that your script doesn't print anything before your redirect header is sent. – px1mp Oct 27 '13 at 17:40
0

Your header() call must be sent before writing any html code (no one 'echo' call and no text before the first <?php).

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141