PHP page change

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
ltaudio
Forum Newbie
Posts: 1
Joined: Mon Oct 05, 2009 10:47 am

PHP page change

Post by ltaudio »

Here is the scenario, I have a few pages deep site that runs off a db, my hang up is if there is only one result found I do not want to display the same page as the rest, since it pass's the variable into the new page and then executes I am not sure how to write an if statement similar to this.

<pseudo>
if ( resultsFromDB == "1"){ "take me to another page and pass.php?value1=$value1&value2=$value2";}
</pseudo>

this must happen and be taken to another page with out making a stop on this page.
User avatar
N1gel
Forum Commoner
Posts: 95
Joined: Sun Apr 30, 2006 12:01 pm

Re: PHP page change

Post by N1gel »

Something like this will forward you onto a differnet page and pass the variables.

Code: Select all

 
if(resultsFromDB == "1")
{
    header("Location: pass.php?value1=$value1&value2=$value2");
    exit();
}
 
Post Reply