At the moment we use User Agent to discover if user is accessing announce from web browser or not, but if some smart ass would change user agent to something else it would very easily allow cheating...
This is fixed on lots of tbdev trackers however so I took their code and edited it to our purpose - thanks to the original creator!
So far we have this:
if (eregi("(Mozilla|Opera|Lynx|Netscape)",$HTTP_SERVER_VARS["HTTP_USER_AGENT"])) {
die("<html><head><title>Error!</title></head><body><h3>Sorry, but this file is not suitable for browsers.</h3></body></html>");
}
What I'm suggesting is adding these lines below:
$headers = getallheaders();
if (isset($headers["Cookie"]) || isset($headers["Accept-Language"]) || isset($headers["Accept-Charset"])) {
die("<html><head><title>Error!</title></head><body><h3>Sorry, but this file is not suitable for browsers.</h3></body></html>");
}
unset($headers);
If your server doesn't have (or allow) function getallheaders like mine (you're not using apache for example), then add these before the code:
if (!function_exists('getallheaders'))
{
function getallheaders()
{
foreach ($_SERVER as $name => $value)
{
if (substr($name, 0, 5) == 'HTTP_')
{
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}