Page 1 of 1
header('Location: http://www.example.com/')
Posted: Wed Apr 14, 2010 7:32 am
by thamizh
header('Location:
http://www.test.com/")
why this syntax that is header is not working in the localhost
it does not makes a redirection
am using javascript(window.location for redirection)
pls give me a solution for this problem
Re: header('Location: http://www.example.com/')
Posted: Wed Apr 14, 2010 7:34 am
by roders
correct syntax for this is
Code: Select all
header('Location:http://www.test.com/');
Do you get any error message when you run it?
Re: header('Location: http://www.example.com/')
Posted: Wed Apr 14, 2010 12:03 pm
by solid
Just for clarity, you were opening with a single-quote, and ending with a double-quote.
Re: header('Location: http://www.example.com/')
Posted: Wed Apr 14, 2010 11:41 pm
by thamizh
now the header syntax works for me
but sometimes am getting this warning :Headers already sent
why this warning comes ?

Re: header('Location: http://www.example.com/')
Posted: Thu Apr 15, 2010 12:13 am
by Bind
that error means the script output something before the header(), whether that be whitepace, lines, or html.
remove the items being output prior to the header() call or use
php output buffer control