Page 1 of 1

how to automatically open a new page?

Posted: Mon Mar 03, 2003 12:50 pm
by permutations
How do I use PHP to automatically load a new page into the browser depending on the outcome of an IF statement?

Posted: Mon Mar 03, 2003 12:55 pm
by gdrums
I think this will help you below, it was posted on here the other day.

Code: Select all

<?php 
// Check to see if they were accepted, if so send them to thier specified pages 
if ($accepted == "True") 
   &#123; // url can be a variable (like I have here) or hard-coded.  It can also be relative or absolute. 
       header("Location: ".$your_url_goes_here); 
   &#125; 
else 
   &#123; 
       header("Location: ".$your_url_goes_here); 
   &#125; 
?>

Posted: Mon Mar 03, 2003 2:09 pm
by permutations
THANK YOU!! That's just what I needed.