Posts: 2,536
Location: Western Maryland
|
Quote:
|
Originally Posted by waller
Is there any function that can take a user to another link. For example.......
PHP Code:
if($ax="1")
{ thefunction(thelink1) };
else
{ thefunction(thelink2) };
|
waller, this can be done if you have not yet sent any content to the client (includes blank lines, any HTML, print statements, etc). Use the header() function.
PHP Code:
$ax = $_GET[somevar];
if( $ax = 1 )
{
header("Location: http://www.somewhere.com" );
}
else
{
header( "Location: http://somewhere-else.com" );
}
This will work. What will not work is if you have any blank lines or content before the call to the header() function.
__________________
—Kyrnt
Last edited by Kyrnt; 06-16-2005 at 12:18 PM..
|