This isn't fool proof though, so don't use it for any authentication or security purpose
<?php
if(strtolower($_SERVER['HTTP_REFERER'])=="http://yourallowedurl.com/etc.html")
{
echo "OK";
}
else
{
echo "connection failed";
}
?>
Note: You might want to create a session for the people who are logged in and allow only those with proper session values set to visit that protected page.