redirecting back to some page.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sangfroid
Forum Newbie
Posts: 5
Joined: Tue Jun 10, 2008 9:25 am

redirecting back to some page.

Post by sangfroid »

Hi
I would like to redirect the user directly to some other page after some time ( say if user has supplied incorrect password or so )


I used the header function, but it is saying something like

Cannot modify header information - headers already sent by (output started at /var/www/html/fileupload.php:9) in /var/www/html/fileupload.php on line 17


Which function do I need to set a timer and also to redirect to some other page automatically ?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: redirecting back to some page.

Post by pickle »

You can only send headers if no other output has been sent to the browser - such as text. The error you're getting says output was already sent to the browser on line 9 of your file.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
sangfroid
Forum Newbie
Posts: 5
Joined: Tue Jun 10, 2008 9:25 am

Re: redirecting back to some page.

Post by sangfroid »

how to solve it in that case ? 8O
pickle wrote:You can only send headers if no other output has been sent to the browser - such as text. The error you're getting says output was already sent to the browser on line 9 of your file.
sangfroid
Forum Newbie
Posts: 5
Joined: Tue Jun 10, 2008 9:25 am

Re: redirecting back to some page.

Post by sangfroid »

I got it... It's solved now...
Thank you
sangfroid wrote:how to solve it in that case ? 8O
pickle wrote:You can only send headers if no other output has been sent to the browser - such as text. The error you're getting says output was already sent to the browser on line 9 of your file.
Post Reply