Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URL redirect based on counter number

Status
Not open for further replies.

keen01

MIS
Nov 16, 2004
73
US
I need to create a URL redirect that goes to one page if visitor number equals one else go to another page.
 
look in the manual for the ternary operator and the header() function

Code:
<?php
$url = $visitorNumber == 1 ? 'somepage.php' : 'anotherpage.php';
header('Location: ' . $url);
exit;
?>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top