note 97114 added to function.header
| From: | marcel dot glacki at stud dot fh-swf dot de | Date: | Fri, 02 Apr 2010 02:37:13 +0000 |
| Subject: | note 97114 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167637@lists.php.net to get a copy of this message | ||
Several times this one is asked on the net but an answer could not be found in the docs on php.net
...
If you want to redirect an user and tell him he will be redirected, e. g. "You will be
redirected in about 5 secs. If not, click here." you cannot use header( 'Location:
...' ) as you can't sent any output before the headers are sent.
So, either you have to use the HTML meta refresh thingy or you use the following:
<?php
header( "refresh:5;url=wherever.php" );
echo 'You\'ll be redirected in about 5 secs. If not, click <a
href="wherever.php">here</a>.';
?>
Hth someone
----
Server IP: 69.147.83.197
Probable Submitter: 82.207.230.75
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/97114
Del: integrated -- https://master.php.net/note/delete/97114/integrated
Del: useless -- https://master.php.net/note/delete/97114/useless
Del: bad code -- https://master.php.net/note/delete/97114/bad+code
Del: spam -- https://master.php.net/note/delete/97114/spam
Del: non-english -- https://master.php.net/note/delete/97114/non-english
Del: in docs -- https://master.php.net/note/delete/97114/in+docs
Del: other reasons-- https://master.php.net/note/delete/97114
Reject -- https://master.php.net/note/reject/97114
Search -- https://master.php.net/manage/user-notes.php