hi guys,
merry xmas!
Um, i have a working curl mod but iv just coded this 1 and need 2 know if it works:
function subBacklink($link, $subBacklink) {
global $subBacklink;
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 10, // timeout on connect
CURLOPT_TIMEOUT => 10, // timeout on response
CURLOPT_MAXREDIRS => 1, // stop after 10 redirects
);
$ch = curl_init( $surl );
curl_setopt_array( $ch, $options );
$page = curl_exec( $ch );
curl_close( $ch );
}
can one say this will work ......? Also i would like to add a
preg
check too.
Atm the 1 below works fine, but not for all sites, so im thinking teh curl above may work better......?
function subBacklink($link, $subBacklink) {
global $subBacklink;
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.80 (Windows NT 5.1; U; en) Presto/2.7.62 Version/11.01');
$page = curl_exec($ch);
curl_close($ch);
}
atm this is how im checking if a linkback is visble or not:
if (stripos($page,$subBacklink) || stripos($page, str_replace("http://www.", "http://", $subBacklink)))
return true;
else
return false;
}
so if theres no visible link, it does a blacklist of $surl otheerwise if there is a lnik it continues the script:
if(subBacklink ($surl, $subBacklink) == false) {
mysql_query("INSERT INTO wcddl_blacklist (url,reason,dat,email) VALUES ('".mysql_real_escape_string($surl)."','".mysql_real_escape_string($reason)."','".mysql_real_escape_string($date)."','".mysql_real_escape_string($email)."')");
blacklistemail($email,$surl);
}
so i need to know is my modded code working? and how to aadd a preg check........?