Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÀûÓÃipµØÖ·²éѯÇøÓò php³ÌÐò

¸Ã³ÌÐòûÓÐÓÅ»¯ Ö»ÊÇ×îԭʼµÄ³ÌÐò  ¿ÉÒÔ½«ÆäÓëflash½áºÏÆðÀ´£¡
Óëflash½áºÏÆðÀ´¾ÍÊǽ«phpµÃµ½µÄµØÖ·ºÍÇøÓò ´òÓ¡³öÀ´ÔÙ·µ»Ø¸öflash¶ËÕâô¼òµ¥
<?php
$getIP="218.11.140.23"; // ÕâÀïÊÇ×Ô¼ºËæ±ãдµÄÒ»¸öip  ʵ¼ÊʱÄ㻹Ҫͨ¹ý³ÌÐòµÃµ½Õâ¸öip
//Ö»¿ªÊ¼Ê±²éÇ°Èý¶Î
$subIPs=explode(".",$getIP);
$subIP=$subIPs[0].$subIPs[1].$subIPs[2];
$lastIP=$subIPs[3];
$url="http://localhost/zendphp/IPQuery/ip.txt";//ÎÒµÄipÊý¾Ý¿âÎļþ ÎÒÓõÄÊÇtxt¸ñʽ
if(file_exists($url)){
 die("δÕÒµ½Îļþ");
 return;
 }
$rows=file($url);
//ÐÐÊý
$len=count($rows);
$p=0;
$collection=array();
foreach ($rows as $line){
 $ipData=preg_split ('/[\s]+/',$line);//×¢ÒâÕâÀïµÄ¿Õ°×Æ¥Åä
 $startIP=$ipData[0];
 //$endIP=$ipData[1];
 $ipSerials=explode(".",$startIP);
 //Ä¿±êip
 $ip=$ipSerials[0].$ipSerials[1].$ipSerials[2];
 $last=$ipSerials[3];
 //ipÐÅÏ¢
 $areaInfo=$ipData[2].$ipData[3];
 //ÕâÀï¿ÉÒÔÓöþ·Ö²éÕÒ£¬ÎªÁ˼ò±ã¾ÍÖ±½Ó²é°É
 
 if($subIP==$ip){
  $p++;
  
  if($p>1){
   if($lastIP==$last){
    
   echo "ÄãµÄipµØÖ·ÊÇ".$getIP."<br/> ÄúËùÔڵĵط½ÊÇ".$areaInfo; 
   }
  
  
 }else{
 echo "ÄãµÄipµØÖ·ÊÇ".$getIP."<br/> ÄúËùÔڵĵط½ÊÇ".$areaInfo;
  
  
 }
 
 }
 
 
 
}
?>


Ïà¹ØÎĵµ£º

PHP˳ÐòÅÅÐò


PHPµÄËã·¨¶¼ÓÐÄÄЩÄØ£¿
ÎÒ»¹¼ÇµÃÉÏ´óѧÄÇ»áѧÊý¾Ý½á¹¹Ê±£¬Á˽âÁË:˳Ðò·¨¡¢Ã°ÅÝ·¨¡¢¶þ·Ö·¨ÒÔ¼°¶ÔÏßÐÔ±íÒÔ¼°Êý¾ÝÈëÕ»¡¢³öÕ»µÄ²Ù×÷¡£
PHPÖеÄ˳Ðò·¨¾ÍÊǶÔÊý×éÔªËصÄÖðÒ»±È½Ï¶øµÃµ½µÄ¡£
ÀýÈ磺
 
<?php
function order($php,$k)
{
 $n = count($php);  //¼ÆËãÊý×é¸öÊý
 $php ......

JAVAºÍPHP»ñÈ¡mysql×îºó²åÈëµÄ×ÔÔöidÖµ

phpºÍjavaͨÓÃsqlÓï¾ä·¨
SELECT max(id) from table
¸Ã·½·¨ÔÚ¶àÏ̵߳ÈÇé¿öÏ¿ÉÄÜ»áÔì³É²»ÕýÈ·¡£
javaÈýÖÖ·½·¨
1¡¢¸ù¾ÝpsµÄgetGeneratedKeys
PreparedStatement ps = conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS); //ºìÉ«Êǹؼü
ps.executeUpdate(); //Ö´Ðкó
ResultSet rs = ps.getGeneratedKeys ......

ʵÏÖPHP·ÃÎÊMYSQLÊý¾Ý¿âµÄÀà

PHPµÄÒ»¸öÊý¾Ý¿â²Ù×÷Àà,ÒÔUTF8¸ñʽдÈë,Êý¾Ý¿âÄÚÖ±½ÓÏÔʾÕý³£ÖÐÎÄ,·ÀÖ¹²éѯ³ö´í
/**
* @author xggxnn
* ±¾ÀàÓÃÓÚʵÏÖÓйØÊý¾Ý¿âµÄ·ÃÎÊ
*
*/
class DBConnection {
private $host = "";
private $user = "";
private $pass = "";
private $DBname = "";
public $isConnected = false;
/**
* ¹¹Ôìº ......

ÓÃPHP×ö¸öÈ˲ÅÕ¾

  ×î½üÓÐÈËÔÚÕбêÒª×ö¸öÏñ£ºwww.webjianzhi.com ÕâÑùµÄÈ˲ÅÕ¾£¬³õ¿´£¬Õâ¸öÍøÂç¼æÖ°Íø£¬½çÃ滹ÊDZȽÏÇåÎúµÄ¡£
 ÕûÌå·ÖÎöÁËһϣ¬Ò»¸öÐÂÎÅÎÄÕ·¢²¼ÏµÍ³£¬Õâ¸ö²»ÊǺÜÄÑ£¬ÁíÒ»¸ö¾ÍÊÇ×ֶε÷ÓÃϵͳ£¬¾ÍÊÇÊ×Ò³µÄÖ°Òµ½éÉÜ£¬¼æÖ°ÈËÆø£¬µÄÕâЩµ÷Óá£
 ÁíÒ»¸ö¾ÍÊÇ»áÔ±·¢²¼ÏµÍ³¡£
  Õû¸öÓñí¸ñ²¼¾Ö£¬ÃÀ¹¤Éϲ»´æÔ ......

[ת]phpÖж¨½ç·û<<<µÄ×÷ÓÃ


phpÖж¨½ç·û<<<µÄ×÷Óà - [phpÓï
ÑÔ
]
[Time:2009-08-18]
°æȨÉùÃ÷
£º×ªÔØʱÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂԭʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
ת×Ô:http://star210.blogbus.com/logs/44486135.html
ÒòΪPHPÊÇÒ»¸öWeb±à³ÌÓïÑÔ£¬ÔÚ±à³Ì¹ý³ÌÖÐÄÑÃâ»áÓöµ½ÓÃechoÀ´Êä³ö´ó¶ÎµÄhtmlºÍjavascript
½Å
±¾µÄÇé¿ö£¬Èç¹ûÓô«Í³µÄÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ