php»ñÈ¡¿Í»§¶Ë²Ù×÷ϵͳÐÅÏ¢£¨ÀàÎļþ£©
<?php
class ClientGetObj{
function getOS(){
global $_SERVER;
$agent=$_SERVER["HTTP_USER_AGENT"];
$os=false;
if(eregi("win",$agent)&&strpos($agent,"95")){
$os="Windows 95";
}else if(eregi("win 9x",$agent)&&strpos($agent,"4.90")){
$os="Windows ME";
}else if(eregi("win",$agent)&&eregi('98',$agent)){
$os="Windows 98";
}else if(eregi("win",$agent)&&eregi('nt 5.1',$agent)){
$os="Windows XP";
}else if(eregi("win",$agent)&&eregi('nt 5',$agent)){
$os="Windows 2000";
}else if(eregi("win",$agent)&&eregi('nt',$agent)){
$os="Windows NT";
}else if(eregi("win",$agent)&&eregi('32',$agent)){
$os="Windows 32";
}else if(eregi("linux",$agent)){
$os="Linux";
}else if(eregi("unix",$agent)){
$os="Unix";
}else if(eregi("sun",$agent)&&eregi("os",$agent)){
$os="SunOS";
}else if(eregi("ibm",$agent)&&eregi("os",$agent)){
$os="IBM OS/2";
}else if(eregi("mac",$agent)&&eregi("pc",$agent)){
$os="Macintosh";
}else if(eregi("powerpc",$agent)){
$os="PowerPC";
}else if(eregi("aix",$agent)){
$os="AIX";
}else if(eregi("HPUX",$agent)){
$os="HPUX";
}else if(eregi("netbsd",$agent)){
$os="NetBSD";
}else if(eregi("bsd",$agent)){
$os="BSD";
}else if(eregi("OSF1",$agent)){
$os="OSF1";
}else if(eregi("IRIX",$agent)){
$os="IRIX";
}else if(eregi("FreeBSD",$agent)){
$os="FreeBSD";
}else if(eregi("teleport",$agent)){
$os="teleport";
}else if(eregi("flashget",$agent)){
$os="flashget";
}else if(eregi("webzip",$agent)){
$os="webzip";
}else if(eregi("offline",$agent)){
$os="offline";
}else{
$os="Unknown";
}
return $os;
}
}
/*²âÊÔ£º
$myos=new ClientGetObj;
$result=$myos->getOS();
echo "¿Í»§¶Ë²Ù×÷ϵͳΪ£º".$result;
*/
?>
Ïà¹ØÎĵµ£º
°ÑphpÊý¾Ý»òÖµ´«µÝ¸øjs
£ººÜ¼òµ¥£¬Ö±½ÓÔÚjsÖÐʹÓÃphp´úÂ룬»ì±à¼´¿É¡£
°ÑjsÊý¾Ý´«µÝ¸øphp
£º¿ÉÒÔʹÓôò¿ªÐ´°¿ÚµÄ·½Ê½£¬Í¨¹ýurlµØÖ·°ÑÊý¾Ý´«µÝ¹ýÈ¥¡£Ò²¿ÉÒÔʹÓÃajax£¬Í¨¹ýget»òpost´«µÝ¸øphp£¬Ò²¿ÉÒÔ±£´æcookieÈÃphpÀ´¶Á¡£
ÔÚ´«µÝÊý¾Ý¹ý³ÌÖпÉÄÜÓöµ½ÖÐÎıàÂë
ÎÊÌ⣬¿ÉÒÔͳһ±àÂ뷽ʽΪjsµÄescape£¬unescape£¬Ò²¿ÉÒÔÍ³Ò ......
Ò».Ê×ÏÈÊÇPHPÍøÒ³µÄ±àÂë
¡¡¡¡1.phpÎļþ±¾ÉíµÄ±àÂëÓëÍøÒ³µÄ±àÂëӦƥÅä
¡¡¡¡a.Èç¹ûÓûʹÓÃgb2312±àÂ룬ÄÇôphpÒªÊä³öÍ·£ºheader(“Content-Type: text/html; charset=gb2312")£¬¾²Ì¬Ò³ÃæÌí¼Ó£¬ËùÓÐÎļþµÄ±àÂë¸ñʽΪANSI£¬¿ÉÓüÇʱ¾´ò¿ª£¬Áí´æΪѡÔñ±àÂëΪANSI£¬¸²¸ÇÔ´Îļþ¡£
¡¡¡¡b.Èç¹ûÓûʹÓÃutf-8±àÂ룬ÄÇôphpÒªÊä³ ......
½ñÌìÔÚдһ¸ö¶«Î÷ʱ£¬·¢ÏÖʱ¼äÒ»Ö±¶Ô²»ÉÏ£¬date("Y-m-d h:i:s") ×ÜÊÇÓë·þÎñÆ÷ʱ¼ä²î¼¸¸öСʱ£®
ÔÀ´´Óphp5.1.0¿ªÊ¼£¬php.iniÀï¼ÓÈëÁËdate.timezoneÕâ¸öÑ¡ÏĬÈÏÇé¿öÏÂÊǹرյÄ
Ò²¾ÍÊÇÏÔʾµÄʱ¼ä£¨ÎÞÂÛÓÃʲôphpÃüÁ¶¼ÊǸñÁÖÍþÖαê׼ʱ¼ä
ºÍÎÒÃǵÄʱ¼ä£¨±±¾©Ê±¼ä£©²îÁËÕýºÃ8¸öСʱ
½â¾ö·½Ê½:
Ò»¡ ......
1. ¾¡Á¿²ÉÓôóÁ¿µÄPHPÄÚÖú¯Êý¡£
2. echo ±È print ¿ì¡£
3. ²»Òª°Ñ·½·¨Ï¸·ÖµÃ¹ý¶à£¬×ÐϸÏëÏëÄãÕæÕý´òËãÖØÓõÄÊÇÄÄЩ´úÂ룿
4. ÔÚÖ´ÐÐforÑ»·Ö®Ç°È·¶¨×î´óÑ»·Êý£¬²»ÒªÃ¿Ñ»·Ò»´Î¶¼¼ÆËã×î´óÖµ¡£
5. ×¢ÏúÄÇЩ²»ÓõıäÁ¿ÓÈÆäÊÇ´óÊý×飬ÒÔ±ãÊÍ·ÅÄÚ´æ¡£
6. ²¢·ÇÒªÓÃÀàʵÏÖËùÓеÄÊý¾Ý½á¹¹£¬Êý×éÒ²ºÜÓÐÓá£
7. $row['id']µÄÐ ......
$URL
=‘
http
:
//xxx.xxx.xxx.xx/xx/xxx/top.php';
$post_data
[
'
clientname
'
]
=
"
test08
"
;
$post_data
[
'
clientpasswd
'
]
=
"
test08
"
;
$post_data
[
'
submit
'
]
=
"
¥í¥°¥¤¥ó
"
;
$referrer
=
""
;
// ......