Forum Moderators: coopster
$ref = $_SERVER["HTTP_REFERER"]
if (strstr($ref, "google.com/search?")) {
$search_query = "";
$query_arg = strtok($ref, "&");
while ($query_arg!== false) {
if (strstr($query_arg, "q=")) {
$search_query = substr($query_arg, 2);
break;
}
$query_arg = strtok("&");
}
echo $search_query;
}
Why is this failing on line #2?
Thanks