note 103619 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 04 Apr 2014 11:18:54 +0000 |
| Subject: | note 103619 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199129@lists.php.net to get a copy of this message | ||
Note Submitter: Bharath Gandhi
----
I wanted to redirect my page, after displaying a status result from feedback form submit click, to
the home page of the website. I tried displaying the status message for 'n' seconds,
before redirecting to the homepage, using the 'sleep()' function but I was stuck with the
header ("Location=$url") command, as it always returned the message "headers already
sent", after displaying the status message, and the page was stuck there.
using 'url' instead of 'location' along with the 'refresh' parameter,
instead of 'sleep()' function, worked for me in this case.
<?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>.';
?>