=$_SERVER['SERVER_NAME']?>Pretype.com Link Exchange
$value) {
$value = urlencode(stripslashes($value));
$QueryString .= "&$key=$value";
}
// congfigure pretype headers
if(intval(get_cfg_var('allow_url_fopen')) && function_exists('readfile')) {
if(!@readfile("http://www.pretype.com/process.php?".$QueryString)) {
echo "Error processing request";
}
}elseif(intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) {
if(!($content =@file("http://www.pretype.com/process.php?".$QueryString))) {
echo "Error processing request";
}
else {
echo @join('', $content);
}
}elseif(function_exists('curl_init')) {
$ch = curl_init ("http://www.pretype.com/process.php?".$QueryString);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
if(curl_error($ch))
echo "Error processing request";
curl_close ($ch);
}else {
echo "It seems that your web host has disabled all functions for
handling remote pages and as a result the PreType link exchange software will not
function on your web site. Please contact your web host and ask them
to enable PHP curl or fopen.";
}
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
$pos = strpos($protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'], "?");
if( $pos ) {
return substr($protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'], 0, $pos);
} else {
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
}
function strleft($s1, $s2) {
return substr($s1, 0, strpos($s1, $s2));
}
?>
|