flashÓëphp½áºÏʵÏÖIP¼°¹éÊôµØ²éѯ
Êý¾Ý¿âÊÇ ´¿ÕæÊý¾Ý¿â ¸ñʽΪ UTF-8 txt¸ñʽ
phpÎļþÊÇUTF-8±àÂë
demo : http://dreamnight.gicp.net/zendphp/IP/connect.swf
flash¶Ë£º
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.ProgressEvent;
//import flash.text.TextFormat
//flash.system.System.useCodePage=true;//
var myIP:String;
var myPlace:String;
var loader:URLLoader= new URLLoader();
var id=getTimer();
var url:String = " http://dreamnight.gicp.net/zendphp/IP/ipTest.php";
var urlRequest:URLRequest = new URLRequest(url+"?id="+id);
loader.dataFormat=URLLoaderDataFormat.VARIABLES;
loader.load(urlRequest);
loader.addEventListener(Event.COMPLETE,handle);
loader.addEventListener(ProgressEvent.PROGRESS,onProgress);
//var format:TextFormat= new TextFormat();
//format.font="ËÎÌå";
//showText.defaultTextFormat=format;
function handle(e:Event):void{
trace("¼ÓÔØÍê³É");
var phpData:*=e.target.data;
trace(phpData);
myIP=String(phpData.ip);
trace(myIP);
myPlace=String(phpData.area);
trace(myPlace);
showText.text="ÄúËùÔÚµÄλÖÃÊÇ"+myPlace+"\nÄúµÄIPµØÖ·ÊÇ"+myIP;
//ÊÍ·ÅÄÚ´æ
loader.removeEventListener(Event.COMPLETE,handle);
loader.removeEventListener(ProgressEvent.PROGRESS,onProgress);
url="";
urlRequest=null;
loader=null;
}
function onProgress(e:ProgressEvent):void{
var percent:int=int(e.bytesLoaded*100/e.bytesTotal);
showText.text="ÒѾ¼ÓÔØ"+percent+"%";
}
php¶Ë£ºÂ·¾¶ÊÇ £º http://dreamnight.gicp.net/zendphp/IP/ipTest.php
<?php
//header("Content-Type:text/html;charset=gb2312");
//$getIP="111.176.149.35"; // ÕâÀïÊÇ×Ô¼ºËæ±ãдµÄÒ»¸öip ʵ¼ÊʱÄ㻹Ҫͨ¹ý³ÌÐòµÃµ½Õâ¸öip
$getIP="³õʼIP";
$getIP=getIP();
//µÃµ½µ±Ç°Ä¿Â¼
$PHP_SELF=$_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$dir='http://'.$
Ïà¹ØÎĵµ£º
<?
@session_start();
$counter = intval(file_get_contents("counter.dat"));
if(!$_SESSION['jingyun'])
{
$_SESSION['jingyun'] = true;
$counter++;
$fp = fopen("counter.dat","w");
fwrite($fp, $counter);
fclose($fp);
}
?>
×Ü·ÃÎÊ <span style="font-size:14px; color:#FF6600" mce_sty ......
ÎÄ/Fenying
¡¡¡¡ÀýÈçÓг£ÓÃʱ¼ä¸ñʽ yyyy-mm-dd HH:ii:ss£¬ÈçºÎת»»³ÉPHPÖÐdateº¯Êý¿ÉʹÓõÄʱ¼ä¸ñÊ½ÄØ£¿
¡¡¡¡Ê¹Óà PHPTimeFormatfromCommon() ¿ÉÒÔ°ÑͨÓÃʱ¼ä¸ñʽת»»³ÉPHPʱ¼ä¸ñʽ
¡¡¡¡¡¡¡¡PHPTimeFormatfromCommon('yyyy-mm-dd HH:ii:ss') => 'Y-m-d H:i:s'
¡¡¡¡Ê¹Óà PHPTimeFormatToCommon() ¿ÉÒÔ° ......
Ê×ÏÈÉêÃ÷£ºÕâ¸öÊÇÎÒ×ªÔØµÄ£¬ÖÂÁ¦ÓÚΪÏñÎÒÒ»ÑùµÄÐÂÊÖÌṩ°ïÖú£¡
1¡¢IISÏÂ301ÉèÖà InternetÐÅÏ¢·þÎñ¹ÜÀíÆ÷ -> ÐéÄâĿ¼ -> ÖØ¶¨Ïòµ½URL£¬ÊäÈëÐèҪתÏòµÄÄ¿±êURL£¬²¢Ñ¡Ôñ“×ÊÔ´µÄÓÀ¾ÃÖØ¶¨Ïò”¡£
2¡¢ASPϵÄ301תÏò´úÂë
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanent ......
ÔÀí£º¸ù¾Ý²»Í¬µÄIPͳ¼Æ³öµ±Ç°ÓжàÉÙÈËÔÚÏß¡£
ʵÏÖ·½Ê½£º¿ÉÒÔÓÃÊý¾Ý¿â£¬Ò²¿ÉÒÔÓÃÎı¾¡£
ÎÒÕâÀïÓÃÁËÎı¾ÊµÏÖ¡£
<?php
/**
*@ Date 2010.04.07
*@ Author »ªÏÄÖ®ÐÇ PHP100.com
*@ Blog & ......