faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

28 of 50 people (56%) answered Yes
Recently 4 of 10 people (40%) answered Yes


how do I refresh and redirect a page using PHP?

Feb 24th, 2008 20:08
dman, Lee Forkenbrock, v s, http://www.ttnr.org

You can use the header function for redirection...the only thing is 
that you must not output to a webpage(eg. echo...print) before 
executing this function because it will give you an error.  The 
following is the example code from php.net...
header("Location: http://www.php.net/"); /* Redirect browser 
                                            to PHP web site */
exit;                 /* Make sure that code below does 
                         not get executed when we redirect. */