<?php
// ipaddress
$ipaddress = $_SERVER[‘REMOTE_ADDR’];
echo “ipaddress: “. $ipaddress. “<br/><br/>”;
// complete page url
$link = “http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]”;
echo “link: “. $link. “<br/><br/>”;
// page url without parameters
$linkParts = explode(‘?’, $link);
$mypage = $linkParts[0];
echo “mypage: “. $mypage. “<br/><br/>”;
echo “=============================<br/><br/>”;
// parameter string from the url
$pageparms = $_SERVER[“QUERY_STRING”];
$pageparms = strtolower($pageparms);
echo “pageparms: “. $pageparms. “<br/><br/>”;
echo “=============================<br/><br/>”;
// number of parameters specified
$parmParts = explode(‘&’, $pageparms);
$numparts = count($parmParts);
echo “numparts: “. $numparts. “<br/><br/>”;
// 1st parameter if specified
if (0 < $numparts) {
echo “parm1: “. $parmParts[0]. “<br/><br/>”;
}
// 2nd parameter if specified
if (1 < $numparts) {
echo “parm2: “. $parmParts[1]. “<br/><br/>”;
}
// 3rd parameter if specified
if (2 < $numparts) {
echo “parm3: “. $parmParts[2]. “<br/><br/>”;
}
// 4th parameter if specified
if (3 < $numparts) {
echo “parm4: “. $parmParts[3]. “<br/><br/>”;
}
// 5th parameter if specified
if (4 < $numparts) {
echo “parm5: “. $parmParts[4]. “<br/><br/>”;
}
// 6th parameter if specified
if (5 < $numparts) {
echo “parm6: “. $parmParts[5]. “<br/><br/>”;
}
echo “=============================<br/><br/>”;
// see if cow was specified
if ($parmParts[2] == “cow”) {
echo “Found the cow <br/>”;
} else {
echo “Still looking for the cow <br>”;
}
?>