faqts : Computers : Programming : Languages : PHP : Common Problems : Redirects

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

252 of 279 people (90%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

How can I do a redirect in PHP without header( "Location:[...]); ? (i.e. sending to 'thanks' or 'error' html page after submitting a form)

Jul 2nd, 2001 17:12
dave w, Serge K. Keller, php-general mailinglist


Hi,     
I have found that this works:    
    
if ($success)    
{    
    echo '<META HTTP-EQUIV="Refresh" Content="0; URL=success.php">';    
    exit;    
}    
else    
{    
    echo '<META HTTP-EQUIV="Refresh" Content="0; URL=retry.php">';    
    exit;    
}    
    
This causes the browser to open the new page after 0 seconds, i.e immediately.