View Single Post
Old 11-08-2003, 06:06 PM  
gin
Confirmed User
 
Join Date: Sep 2003
Posts: 672
so, some one help him, then maybe alot of people will use it and see their 1:1000 sponsor ratio's are sometimes really 1:5,000.. i have a simple php script that tracks clicks and version of ie..

PHP Code:
<?

function getlang() {
    $headers = getallheaders();
    if(!empty($headers['Accept-Language'])) return chop($headers['Accept-Language']);
    else return "en-us";
}

function addcounter($file) {
    if(file_exists($file)) {
        $lines = file($file);
        $amt = chop($lines[0]);
        if(!isset($amt) || $amt hahahaha "") $amt = 1;
        else $amt++;
        $fp = fopen($file, "w+");
        fputs($fp, $amt);
        fclose($fp);
    }else {
        touch($file);
        chmod($file, 0666);
        addcounter($file);
    }
}


$lang = getlang();
addcounter("langs/" . $lang . ".txt");

switch($lang) {
    case "en-us": header("Location: [url]http://www.domain.com/?id=a[/url]"); die();

    case "en-ca": header("Location: [url]http://www.domain.com/?id=a[/url]"); die();

    case "en": header("Location: [url]http://www.domain.com/?id=a[/url]"); die();
}

header("Location: [url]http://www.dialer.com/[/url]");

?>
make the folder /langs/ and chmod it
gin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote