Php

.

Php-web- > Php

, , , , , , .

1. html .
, , , ,

<?
$time1 = time(); //
$time_m1 = microtime();
//--------------------
//
//--------------------
$time2 = time(); //
$mtime = abs ($time2 - $time1);
$time_m2 = microtime();
$mtime_m = abs ($time_m2 - $time_m1);
$mtime_m = substr($mtime_m, 2, 3);
$mtime .= "." ."$mtime_m";
// $mtime - .
echo $mtime;
?>

2. .
: Explore, Netscape, Opera, , , Robot, , , , . ? - - : ndex, Rambler, Aport, . : - , , , , . , , ndex 10 , 10 . , 3 , , MySql, , , , ( , 2 ), , ndex 2 . , , . , 500 . , , , . , , , , ndex, , , 50 , . , , , .

<?
//
function broser ($pass_br){
if (eregi("Opera", $pass_br)) { $broser = "Opera"; }
else { if (eregi("MSIE", $pass_br)){ $broser = "Explore"; }
else { if (eregi("Gecko", $pass_br) or eregi("Netscape", $pass_br))
{ $broser = "Netscape"; } } }
if($broser == ""){$broser = "Robot";}
return $broser;
}
// HTTP_USER_AGENT
$user = broser ($HTTP_SERVER_VARS["HTTP_USER_AGENT"]);
// Robot, 2
if ($user == "Robot") { sleep(2); }
//--------------------
//
//--------------------
// ,
if ($user != "Robot") {echo", ";}
?>

3. IP.
, IP , IP - 195.162.35.251, (unknown, 195.162.35.251, 195.162.45.351) IP, . IP , , IP. ? , , , . , IP, $ip = unknown

<?
// IP
if(empty($user_ip)){if (getenv('HTTP_X_FORWARDED_FOR'))
{$user_ip=getenv('HTTP_X_FORWARDED_FOR'); }
else{$user_ip=getenv('REMOTE_ADDR'); }}
else{$user_ip=getenv('REMOTE_ADDR'); }
// IP Ip
if(15 < strlen($user_ip)){
$user_ip_pass = split(", ", $user_ip);
for($i=0; $i < sizeof($user_ip_pass); $i++){
if(eregi("unknown", $user_ip_pass[$i]) or $user_ip_pass[$i] == ""){}
else {
if (ereg("[a-zA-Z]", $user_ip_pass[$i])){}
else{$user_ip = $user_ip_pass[$i]; break; }
}
if($i == sizeof($user_ip_pass)-1){$user_ip = "unknown";}
}
}
// Ip
$ip = $user_ip;
//--------------------
//
//--------------------
?>

4. IP .
, , - IP, , , , ( . , 213.172.16.201 213.172.19.124 , .

<?
$ip = "213.172.16.201";
//, IP
function obrez ($ip_pass){
if ( ereg("([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)", $ip_pass, $array))
$array[3] = substr ( $array[3], 0, 1);
$ip_pass = "$array[1].$array[2].$array[3]";
return $ip_pass;
}
// IP 213.172.1
$obrez_ip = obrez ($ip);
//--------------------
//
//--------------------
?>

5. , IP. , , $ip = "unknown", . - , - , . 100 -  5 IP - . , - , , , IP. ,  IP - , . : 1.1.1.1. 127.0.0.0., IP , , - , ...

<?
$ip = "unknown";
//, IP = unknown, IP
if (eregi("unknown", $ip))
{
//
echo " , .
: IP ";
//
exit;
//--------------------
//
//--------------------
}
?>

6. : IP .
, - "" , . , - (, zapret_sait.txt) IP , . IP , , IP , .

<?
//$ip - IP
//
$zapret_sait = forum'>file("zapret_sait.txt");
for ($i = 0; $i < count($ban_sait); $i++)
{
$ban[$i] = ereg_replace("\n","",$ban_sait[$i]);
list($banip,$banmessage)= spliti ("\::",$zapret_sait[$i]);
//, IP
if (eregi("^$banip$",$ip))
{
//
echo" : $ip";
//
exit;
}
}
//--------------------
//
//--------------------
}
?>

7. , exit; , . , :
<?
if ($ == "")
{
//
//
exit;
}
if ($ == "")
(
//
//
exit;
}
?>
, , "", , , , . ? , , , "", . , .

<?
$query = $HTTP_SERVER_VARS["QUERY_STRING"];
//
echo"https://_.ru/_.php?$query url ";
//
exit;
//
?>

, , .


:




, , ( , + ). !

: www.wr-script.ru, 2004-2024.

. WR-Script.ru!

WEB-

WR-Счётчик