how to automatically open a new page?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
permutations
Forum Commoner
Posts: 52
Joined: Sat Dec 07, 2002 11:45 am

how to automatically open a new page?

Post by permutations »

How do I use PHP to automatically load a new page into the browser depending on the outcome of an IF statement?
gdrums
Forum Newbie
Posts: 7
Joined: Mon Nov 18, 2002 4:41 pm

Post 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; 
?>
permutations
Forum Commoner
Posts: 52
Joined: Sat Dec 07, 2002 11:45 am

Post by permutations »

THANK YOU!! That's just what I needed.
Post Reply