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 49 people (57%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

how do I refresh and redirect a page using PHP?

Jan 28th, 2002 12:01
Lee Forkenbrock, v s, www.php.net


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. */