View Single Post
Old 01-26-2013, 05:26 AM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,645
Thanks: 4
Thanked 2,449 Times in 2,418 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I'd suggest a switch though. PHP is a string based language so it is primitive which means you can switch on the string. It simply allows for easier additions should you choose in the future:
PHP Code:
if (isset($_POST['nav']))
{
    switch (
$_POST['nav'])
    {
        case 
"http://css-tricks.com/":
        case 
"http://digwp.com/":
        case 
"http://quotesondesign.com/":
            
header('Location: ' $_POST['nav']);
            break;
        default:
            
// in case you want to do something for every other condition.
    
}

exit() or die() should be called right after the header unless you want the remaining script to still continue processing. Issuing a header doesn't terminate the script run, it simply tells the browser to redirect to a new location.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote