I put mine right after the "$url['host'] = strtolower($url['host']); //lets beat those bloody spammers" part, no need to check for Caps on or off then. I added my extra code in at around line 71 (on v2.6 of original code) Note: mine's not exactly the same as the original submit-proxy.php file but I have other bits added too like https support (see if you can spot it in the code below
). Here's a copy 'n paste of part of my code with the 'free domains block' stuff in bold, you don't have to have so many of course, pick and choose what you wish to use. It works for me.
Code:
if (!$found)
$errors[] = 'Please select the correct category.';
$ipaddress = $_SERVER['REMOTE_ADDR'];
mysql_query("INSERT INTO pl_track (post, time, email, ip) VALUES ('$proxy','".time()."','$email','$ipaddress')") or die(mysql_error());//track what people post
$url = @parse_url($proxy);
if (!isset($url['host']))
$errors[] = 'ERROR: The website address has to be a valid domain name.';
if (strtoupper($url['scheme']) == 'HTTP' || strtoupper($url['scheme']) == 'HTTPS'){
# Do nothing
}
else{
$errors[] = '<br />The website address has to start with either http:// or https://';
}
$url['host'] = strtolower($url['host']); //lets beat those bloody spammers
if (strstr($url['host'], ".vu")) // Block the free TLD .vu
$errors[] = 'ERROR: Sorry ".vu" domains are not currently supported.';
if (strstr($url['host'], ".mn")) // Block the free TLD .mn
$errors[] = 'ERROR: Sorry ".mn" domains are not currently supported.';
if (strstr($url['host'], ".tc")) // Block the free TLD .tc
$errors[] = 'ERROR: Sorry ".tc" domains are not currently supported.';
if (strstr($url['host'], ".tk")) // Block the free TLD .tk
$errors[] = 'ERROR: Free ".tk" domains are not currently accepted.';
if (strstr($url['host'], ".co.cc")) // Block the free SLD .co.cc
$errors[] = 'ERROR: Free ".co.cc" domains are not currently accepted.';
if (strstr($url['host'], ".cu.cc")) // Block the free SLD .cu.cc
$errors[] = 'ERROR: Free ".cu.cc" domains are not currently accepted.';
if (strstr($url['host'], ".co.tv")) // Block the free SLD .co.tv
$errors[] = 'ERROR: Free ".co.tv" domains are not currently accepted.';
if (strstr($url['host'], ".cz.cc")) // Block the free SLD .cz.cc
$errors[] = 'ERROR: Free ".cz.cc" domains are not currently accepted.';
if (strstr($url['host'], ".vv.cc")) // Block the free SLD vv.cc
$errors[] = 'ERROR: Free ".vv.cc" domains are not currently accepted.';
if (strstr($url['host'], ".ce.ms")) // Block the free SLD .ce.ms
$errors[] = 'ERROR: Free ".ce.ms" domains are not currently accepted.';
if (strstr($url['host'], ".cn")) // Block the TLD .cn
$errors[] = 'ERROR: Sorry ".cn" domains are not currently supported.';
if (!$errors && $cfg['checkwhoanswers']) {
$checkch = curl_init();
curl_setopt($checkch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($checkch, CURLOPT_MAXREDIRS, 20);
curl_setopt($checkch, CURLOPT_TIMEOUT, 30);
curl_setopt($checkch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($checkch, CURLOPT_URL, $proxy);
$check_data = curl_exec($checkch);
if (!$check_data) {
$errors[] = 'We were unable to connect back to your proxy to verify it.';
} else {
$actual_url = curl_getinfo($checkch, CURLINFO_EFFECTIVE_URL);
$original_proxy = $proxy;
$proxy = $actual_url;
$original_url = $url;
$url = @parse_url($proxy);
}
curl_close($checkch);
}
If you get a blank page afterwards then there's either a dot/comma/colon/semi-colon/apostrophe or similar character missing or the file was corrupted when it saved (happened to me several times) but editing with gedit or notepad++ seems to work OK, although I use MS FrontPage usually.
Bookmarks