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
header('Location: http://www.example.com/')
Moderator: General Moderators
Re: header('Location: http://www.example.com/')
correct syntax for this is
Do you get any error message when you run it?
Code: Select all
header('Location:http://www.test.com/');Re: header('Location: http://www.example.com/')
Just for clarity, you were opening with a single-quote, and ending with a double-quote.
Re: header('Location: http://www.example.com/')
now the header syntax works for me
but sometimes am getting this warning :Headers already sent
why this warning comes ?
but sometimes am getting this warning :Headers already sent
why this warning comes ?
Re: header('Location: http://www.example.com/')
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
remove the items being output prior to the header() call or use php output buffer control