Greet google referer

Views: 12 Last modified: August 03rd, 2011 Comments: 0

This function will check if your visitor comes from google and greets the visitor.

function greet_google_referer($url)
{
	$message = '';
	if (preg_match('#^http:\/\/www\.google\.([a-z]){2,4}\/.+$#', $url))
	{
		$message = 'Welcome Google user!';
	}

	return $message;
}

Example of use

echo greet_google_referer(@$_SERVER['HTTP_REFERER']);
VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

    Mail this!

    To: From:Sum {0+1} =  
    Anything to add ?

        You must be logged in to post a comment.