Created
August 2, 2008 19:40
-
-
Save slant/3761 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( isset($_GET['id']) && !isset($_COOKIE['campaign']) ) { | |
# preg_match('/-/', $_GET['id']) == true ? list($campaign, $publisher) = split("-", $_GET['id']) : $campaign = $_GET['id']; | |
# in_array($_GET['id'], $ads) ? $campaign_valid = true : $campaign_valid = false; | |
if ( in_array($_GET['id'], $ads) ) { | |
setcookie("campaign", $_GET['id'], time() + 60*60*24*45, "", ".idwatchdog.com"); | |
setcookie("ipaddress", $_SERVER['REMOTE_ADDR'], time() + 60*60*24*45, "", ".idwatchdog.com"); | |
setcookie("accessed_at", date('Y-m-d H:i:s'), time() + 60*60*24*45, "", ".idwatchdog.com"); | |
} | |
} | |
# Will set SESSION data if a campaign code is present | |
if ( isset($_GET['id']) && !isset($_SESSION['campaign']) ) { | |
if ( in_array($_GET['id'], $ads) ) { | |
$_SESSION['campaign'] = $_GET['id']; | |
$_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; | |
$_SESSION['accessed_at'] = date('Y-m-d H:i:s'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment