This is a discussion on Redirect within the PHP General forums, part of the PHP Programming Forums category; Hi there people, I'm looking for a function that will redirect a browser to another page after a PHP ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi there people, I'm looking for a function that will redirect a browser to another page after a PHP scrip has run. I tried serching for it in the doc but found nothing. It shall be similar to Tcl's "ns_returnredirect". Thanx. Joao Penna Andrade Undergraduate, Mechanical Engineering UNICAMP, Brazil |
|
|||
|
On Saturday 25 October 2003 10:54 am, Joao Andrade wrote:
> Hi there people, > > I'm looking for a function that will redirect a browser to another page > after a PHP scrip has run. I tried serching for it in the doc but found > nothing. It shall be similar to Tcl's "ns_returnredirect". > Thanx. You can either use the php function header() or the HTML meta refresh thing. James |
|
|||
|
header() refresh/redirect with delay.
--------------------------- <?php ob_start(); if(!headers_sent()) { header('Refresh: 1; Url=http://www.example.com'); exit(); } ob_end_flush(); ?> --------------------------- header() refresh/re-direct without delay --------------------------- <?php ob_start(); if(!headers_sent()) { header('Location: http://www.example.com'); exit(); } ob_end_flush(); ?> --------------------------- -- Jon Kriek http://phpfreaks.com |