I want to make it on my proxy top site, ProxLists.com, so that if you click any of the links from a site besides ProxLists, it will redirect to the home page instead of to the appropriate proxy. The code I am using is as follows:

$referer = $_SERVER['HTTP_REFERER']; 

if  ($referer != "http://www.proxlists.com") {

header('Location: http://www.proxlists.com');

} else {

$db->query("UPDATE {$db_tp}proxy SET hits = hits + 1 WHERE id = $id");
header('Location: '.$row[0]);

It says that if the Refferer is not ProxLists, it will redirect to the home page. Otherwise, it will add a hit to the count and then redirect to the right proxy.

It does prevent hotlinking, however, if you click on a link in the list, it redirects to the home page as well! Can anybody help?