|
|
PHP Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
<?php // Counter Eintsellungen $partner_uri = $_SERVER['QUERY_STRING']; $new_url = "http://www.".$partner_uri.""; echo $counterdat; $file = "ip_data.dat"; // IP Serre $duration = 30*60; // 30 Minuten $lines = file($file); foreach($lines as $line) { list($ip, $time) = explode("µ", $line); if($time > time()-$duration) { $ips[$ip] = trim($time); } } $ip = $_SERVER['REMOTE_ADDR']; if(@array_key_exists($ip, $ips)) { if($ips[$ip] > time()-$duration) { // TRUE $ips[$ip] = time(); $was_here = TRUE; } } else { $ips[$ip] = time(); $was_here = FALSE; } $fp = fopen($file, "w"); foreach($ips as $ip=>$time) { fputs($fp, $ip."µ".$time."\n"); } fclose($fp); if($was_here) { header( 'Location: '.$new_url.'' ); exit(); } else { $counterdat = "".$partner_uri.".dat"; $datei = fopen("$counterdat","w"); $counter = fgets($datei, 10); $counter = $counter + 1; rewind($datei); file_put_contents("$datei",$counter); fclose($datei); header( 'Location: '.$new_url.'' ); exit(); } ?> |
|
|
PHP Quellcode |
1 |
$datei = fopen("$counterdat","w"); |
Quoted
![]()
PHP Quellcode
1 $datei = fopen("$counterdat","w");
Quoted from ""Torsten""
Die Datei wird doch gelesen, oder nicht?
|
|
PHP Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
<?php // Counter Eintsellungen $partner_uri = $_SERVER['QUERY_STRING']; $new_url = "http://www.".$partner_uri.""; $file = "ip_data.dat"; // IP Serre $duration = 30*60; // 30 Minuten $lines = file($file); foreach($lines as $line) { list($ip, $time) = explode("µ", $line); if($time > time()-$duration) { $ips[$ip] = trim($time); } } $ip = $_SERVER['REMOTE_ADDR']; if(@array_key_exists($ip, $ips)) { if($ips[$ip] > time()-$duration) { // TRUE $ips[$ip] = time(); $was_here = TRUE; } } else { $ips[$ip] = time(); $was_here = FALSE; } $fp = fopen($file, "w"); foreach($ips as $ip=>$time) { fputs($fp, $ip."µ".$time."\n"); } fclose($fp); if($was_here) { header( 'Location: '.$new_url.'' ); exit(); } else { $counterdat = "".$partner_uri.".dat"; if(file_exists($counterdat)){ $datei = fopen("$counterdat","r+"); $counter = intval(fgets($datei, 10)); $counter++; rewind($datei); fwrite($datei, $counter); fclose($datei); header( 'Location: '.$new_url.'' ); exit(); } else{ $datei = fopen("$counterdat","w"); fclose($datei); $datei = fopen("$counterdat","r+"); $counter = intval(fgets($datei, 10)); $counter++; rewind($datei); fwrite($datei, $counter); fclose($datei); header( 'Location: '.$new_url.'' ); exit(); } } ?> |
|
|
PHP Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
<?php // Counter Einstellungen $partner_uri = $_SERVER['QUERY_STRING']; $new_url = "http://www.".$partner_uri.""; $file = "ip_data.dat"; // IP Serre $duration = 30*60; // 30 Minuten $lines = file($file); foreach($lines as $line) { list($ip, $time) = explode("µ", $line); if($time > time()-$duration) $ips[$ip] = trim($time); } $ip = $_SERVER['REMOTE_ADDR']; if(@array_key_exists($ip, $ips)) { if($ips[$ip] > time()-$duration) { // TRUE $ips[$ip] = time(); $was_here = TRUE; } } else { $ips[$ip] = time(); $was_here = FALSE; } //IP Adresse speichern $fp = fopen($file, "w"); foreach($ips as $ip=>$time) { fputs($fp, $ip."µ".$time."\n"); } fclose($fp); //Inkrementieren? if(!$was_here) { $counterdat = "".$partner_uri.".dat"; if(!touch($counterdat)) echo 'CHMOD des ordners stimmt nicht'; chmod($counterdat, 0777); $datei = fopen("$counterdat","r+"); $counter = intval(fgets($datei, 10)); rewind($datei); fwrite($datei, ++$counter); fclose($datei); } //Weiterleiten header("HTTP/1.1 301 Moved Permanently"); header( 'Location: '.$new_url.'' ); exit(); ?> |
Quoted from ""d0nUt""
PS: Warum rückst du deinen code nicht ein *gg*