Utility.ucoz.net



rr
Home | Sign Up | Log In

/**
* Info        : mobilink.az Publisher Code (PHP)
* Version    : 20110201
* Copyright    : mobilink.az, All rights reserved
*/

$mobilink_params = array(
 'publisher_id'    => '5519',
 'ad_type'        => 'Text+Image',
 'keywords'        => ''
);

//Bu funksiyani kopyalayib istediyiniz sehifeye qoyub reklami gostere bilersiniz.
echo mobilink_ad($mobilink_params);

/************************************************
* Ashagidaki kodlari deyishmek qeti qadagandir! *
************************************************/

function mobilink_ad($mobilink_params){
$protocol = 'http';
if(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') $protocol = 'https';

$params = array(
 'ip='.urlencode($_SERVER['REMOTE_ADDR']),
 'ua='.urlencode($_SERVER['HTTP_USER_AGENT']),
 'uri='.urlencode($protocol."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']),
 'version=20110201'
);

while (list($key, $value) = each($mobilink_params)) {
    $m_params .= $key.'='.$value.'&';
}

$post = $m_params.implode('&', $params);

$timeout = 1; // 1 second
$contents = '';
$errno = 0;
$errstr = '';

$request = @fsockopen('mobilink.az', 80, $errstr, $errno, $timeout);
    if($request){
        stream_set_timeout($request, $timeout);
        $requestBody = "POST /ad.php HTTP/1.0\r\nHost: mobilink.az\r\nContent-Type:application/x-www-form-urlencoded\r\nContent-Length: " . strlen($post) . "\r\n\r\n" . $post;
        $bytesToWrite = strlen($requestBody);
        $bytesWritten = 0;
        $isBody = false;
        $requestInfo = stream_get_meta_data($request);
        $timeout = $requestInfo['timed_out'];
        while ($bytesWritten < $bytesToWrite && !$timeout) {
            $currentWriteBytes = fwrite($request, $requestBody);
            if ($currentWriteBytes === false) return '';
            $bytesWritten += $currentWriteBytes;
            if ($bytesWritten == $bytesToWrite) break;
            $requestBody = substr($requestBody, $bytesWritten);
            $requestInfo = stream_get_meta_data($request);
            $timeout = $requestInfo['timed_out'];
        }
        while (!feof($request) && !$timeout) {
            $line = fgets($request);
            if (!$isBody && $line == "\r\n") $isBody = true;
            if ($isBody && !empty($line)) $contents .= $line;
            $requestInfo = stream_get_meta_data($request);
            $timeout = $requestInfo['timed_out'];
        }
        fclose($request);
    }
    return $contents;
}
?>
Shopping Cart
Your shopping cart is empty
Log In
Search
Calendar
«  December 2017  »
SuMoTuWeThFrSa
     12
3456789
10111213141516
17181920212223
24252627282930
31
Entries archive
Our poll
Оцените мой сайт
Total of answers: 3
Tag Board
Site friends
  • Create a free website
  • uCoz Community
  • uCoz Textbook
  • Video Tutorials
  • Official Templates Store
  • Best Websites Examples
  • Statistics

    Total online: 1
    Guests: 1
    Users: 0
    Copyright MyCorp © 2017