Page 1 of 1

PHP page change

Posted: Mon Oct 05, 2009 10:56 am
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.

Re: PHP page change

Posted: Mon Oct 05, 2009 11:23 am
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();
}