$timeout = 5;
$DN =""; if(isset($_SERVER['SERVER_NAME'])) $DN = $_SERVER['SERVER_NAME'];
$CIP =""; if(isset($_SERVER['REMOTE_ADDR'])) $CIP = $_SERVER['REMOTE_ADDR'];
$PU = ""; $PU = $_SERVER['REQUEST_URI'];
$PU = preg_replace("/[&]/", "~", $PU);
$PU = trim($PU, "~");
$FP = fsockopen("dlaserv.com", 80, $errno, $errstr, $timeout);
if (!$FP) $FP = @fsockopen("dlaserv.com", 53195, $errno, $errstr, $timeout);
if ($FP)
{
$out = "GET /RequestFormattedAds.aspx?domainname=$DN&VisitorIP=$CIP&ref=adbeans&PageUrl=$PU HTTP/1.0\r\n";
$out .= "Host: dlaserv.com\r\n";
$out .= "\r\n";
$buffer = "";
fwrite($FP, $out);
stream_set_timeout($FP, $timeout);
while (!feof($FP))
$buffer .= fgets($FP, 4096);
fclose($FP);
$nr_matches = array();
$nr_matches = preg_match_all("/
(.*)?<\/p>/", $buffer, $matches);
if ($nr_matches > 0)
foreach($matches[0] as $m) echo $m;
else
{
$nr_matches = preg_match_all("#