Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Anti proxy

Parašė mariuse3· 2008 Rugp. 26 20:08:39
#1

Sveiki. Galit pasakyti ka daryti kada as idedu sita koda man meta errorus ka daryt? gal netaip dedu nzn tada jus pasakykit kur ji idet :?
<?php

class proxyfloodcheck {

var $timeout = 600;
var $maxconnects = 200;
var $count = 0;
var $proyx_online = "proxy_connects";

function floodcheck () {
$this->timestamp = time();
$this->ip = $this->ipCheck();
$this->new_proxy();
$this->delete_proxy();
$this->check_proxy();
}

function ipCheck() {
if(getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
}
elseif(getenv('HTTP_X_FORWARDED')) {
$ip = getenv('HTTP_X_FORWARDED');
}
else(getenv('HTTP_FORWARDED_FOR')) {
$ip = getenv('HTTP_FORWARDED_FOR');
}
return $ip;
}

function new_proxy() {
GLOBAL $ip, $path;
$path = $_SERVER['PHP_SELF'];
$ip = $this->ip;

IF(!empty($ip)) {
$insert = mysql_query("insert into $this->proyx_online(id, time, path, userip) values('', '$this->timestamp', '$path', '$this->ip')") or die("Proxy Query =".mysql_error());
}
}

function delete_proxy() {
$delete = mysql_query("delete from $this->proxy_online where $this->proxy_online.time < ($this->timestamp - $this->timeout)") or die("Proxy Query =".mysql_error());
}

function check_proxy() {
GLOBAL $maxconnects
$count = mysql_num_rows(mysql_query("select distinct $this->proxy_online.userip from $this->proxy_online"));

IF($count > $maxconnects) {
echo "Boo Badass $maxconnects You're pretty smart.<br>";
echo "<br>You're not allowed to use proxies, Please disable your proxies and revisit, Thanks $maxconnects Number of Online proxies= <br>";
exit;
}
}

}

floodcheck();

?>



Redagavo Žmogus· 2008 Rugp. 26 21:08:11

Parašė adulis· 2008 Rugp. 26 21:08:46
#2

Išjungiam šypsenėles.

Parašė Dandžu· 2008 Rugp. 26 21:08:46
#3

Jam reikia mysql lentelių.

Parašė mariuse3· 2008 Rugp. 26 21:08:42
#4

is kur jas gaut?

Parašė Dandžu· 2008 Rugp. 26 21:08:08
#5

Pagal kodą susirašyk pats. Nes kiek ieškojau pats neradau. Arba prašyk pas ką nors gal už pinigus padarys o jeigu atsiras toks geras dėdė kuris nemokamai padarys tai bus jau čia stebuklas. ;)