Page 1 of 1

redirecting header

Posted: Fri Jun 16, 2006 1:22 pm
by rambabu
can anyone help me out...

i have a login page...in php and i am doing the validations...but unable to redirect to my homepage...

header("Location:http://www.searchyd.com/index.php");

warning message:Cannot modify header information - headers already sent by (output started at /var/www/vhosts/searchyd.com/httpdocs/user/db.php:2)

Posted: Fri Jun 16, 2006 1:38 pm
by ambivalent

Re: redirecting header

Posted: Fri Jun 16, 2006 1:47 pm
by RobertGonzalez
rambabu wrote:can anyone help me out...

i have a login page...in php and i am doing the validations...but unable to redirect to my homepage...

header("Location:http://www.searchyd.com/index.php");

warning message:Cannot modify header information - headers already sent by (output started at /var/www/vhosts/searchyd.com/httpdocs/user/db.php:2)
Just as an FYI, this error has been posted in this community like ten times in the last two weeks. Did you search first before posting? I am not trying to be rude, just trying to keep you coming back.

The error you are getting is because you are sending output to the browser at some point prior to your posted call to header(). Once anything has been sent to the browser you will get that error when using header().