Home › Forums › Back End › If/Else statement, different analytics code depending on URL › Re: If/Else statement, different analytics code depending on URL
December 8, 2009 at 7:19 pm
#67860
Member
Humm, with that tree, PHP_SELF will still work, but you’ll have to rearrange the if/elses or else customer would be caught right off the bat.
Code:
$mypath = $_SERVER[“PHP_SELF”];
if (substr_count($mypath, “documents”) > 0) { // Catch documents
} elseif (substr_count($mypath, “quote”) > 0){ // Catch quote
} else { // Catch all (customer)
}