PHP´¦ÀíÔÚÏßÓû§
תÌù×Ô: http://hi.baidu.com/isnono/blog/item/3c94ea11a54a0fc7a7ef3f94.html
¾³£ÔÚCSDNµÄPHPÂÛ̳ÉÏ¿´µ½ÓÐÅóÓÑÎÊ´¦ÀíÔÚÏßÓû§µÄÎÊÌâ,ÎÒд¹ýÀàËƵĴúÂë,¾ÍÄóöÀ´Ï׳óÁË,ÓеãÀ¬»ø,»ù±¾ÉÏʵÏÖÁ˹¦ÄÜ, ͬÊÇÒ²Äܹ»À©Õ¹£¬±ÈÈçͬʱֻÔÊÐíÒ»¸öÕʺÅÔÚÏߵȡ£
/*
³ÌÐòÓÃ;£º¼ì²âÔÚÏßÓû§
³ÌÐò×÷Õߣºheiyeluren
д×÷ʱ¼ä£º2004/6
*/
<? session_cache_limiter("private,max-age=10800"); ?>
<? @session_start(); ?>
<? include("Function.php"); ?>
<? include("ConnDB.php"); ?>
<? include("Const.php"); ?>
<?php
//ÔÚÏßÓû§´¦Àí
if (isset($user_name))//Èç¹ûsessionдÁË,ÄÇôÓû§ÒѾµÇ½
{
$result = mysql_query("SELECT * from aliang_online WHERE OnlineUser = '$user_name' ") or die($die_msg."Óû§ÓÐûÓÐдÈëÔÚÏßÁбí");
//²éѯ¿´¿´Óû§ÓÐûÓÐдÈëÔÚÏßÁбí
$num = mysql_num_rows($result);
if ($num != 0) //Èç¹ûÒѾдÈëÁËÔÚÏßÁбí,¾Í¸üÐÂ×îºóÔÚÏßʱ¼äºÍ״̬
{ //$now_timeÊÇ×Ô¶¨ÒåµÄÒ»¸ö³£Á¿,´ú±íÏÖÔÚʱ¼äµÄʱ¼ä´Á,¸Ã³£Á¿ÔÚconst.phpÖÐÉèÖÃ
mysql_query("UPDATE aliang_online SET LastTime = $now_time,UserState = 1 WHERE OnlineUser = '$user_name' ") or die($die_msg."Èç¹ûдÁË,ÄǾ͸üÐÂʱ¼ä");
}
else //Èç¹ûÓû§Ã»ÓÐÔÚÔÚÏßÁбí,ÄÇô¾Í°Ñ¸ÃÓû§Ð´ÈëÔÚÏßÓû§Áбí
{
mysql_query("INSERT INTO aliang_online SET OnlineUser = '$user_name' , LoginIP = '$REMOTE_ADDR' , LoginTime = $now_time , LastTime = $now_time , UserState = 1 ") or die($die_msg."Èç¹ûûÓÐд,ÄǾÍд");
}
}
else //Èç¹ûÓû§Ã»Óеǽ,»òÕßÊǷÿÍ,ÄÇô¾ÍʹÓÃIPµØÖ·À´¶¨Î»ÊÇ·ñÒѾÔÚÔÚÏßÁбí
{
$result = mysql_query("SELECT * from aliang_online WHERE LoginIP = '$REMOTE_ADDR' ") or die($die_msg."Èç¹ûÊǷÿÍ,¾Í¿´¿´ÓÐûËûIP");
$num = mysql_num_rows($result);
if ($num != 0) //Èç¹û·Ã¿ÍµÄIPµØÖ·ÒѾÔÚÁбíÖÐÁË,ÄÇô¾Í¸üзÿÍ×îºóʱ¼äºÍ״̬
{
mysql_query("UPDATE aliang_online SET LastTime = $now_time,UserState = 1 WHERE LoginIP = '$REMOTE_ADDR' ") or die($die_msg."Èç¹ûÓÐIP,¾Í¸üÐÂËûµÄʱ¼ä");
}
else &
Ïà¹ØÎĵµ£º
ËäÈ»±¾ÈËûÓÐÑéÖ¤¹ý,²»¹ý¾Ý˵ͨ¹ýADODB·ÃÎÊOracle¶ÔÐÔÄÜÓ°ÏìºÜС.¶øÇÒADODB±ÈOCI8Ò²Òª·½±ãºÜ¶à,±Ï¾¹Ðí¶à¶«Î÷¶¼Ôٴηâ×°¹ý.²»¹ý²»¹ÜÔõô˵ÕⶼÔÚÖмäÓÖ¼ÓÉÏÁËÒ»²ã,ÀíÂÛÉÏÀ´Ëµ³öÏÖÎÊÌâµÄ¼¸Âʺͽâ¾öÎÊÌâµÄÄѶȶ¼±ä´óÁË.¶øOracleÓÖ¾³£ÓÃÔÚ²»ÄÜËæ±ã³öÎÊÌâµÄ»·¾³,ËùÒÔÏë±ØÏëÒªÖ±½ÓʹÓÃOCIµÄÇé¿öÒ²²»ÉÙ.ÒÔϾÍÊÇÎÒµÄÀý×Ó:
<?p ......
Ò»¡¢¿ª·¢³ÉÔ±
a)ÏîÄ¿Ö÷¹Ü
b)Ò³ÃæÃÀ¹¤
c)Ò³Ã濪·¢
d)·þÎñ¶Ë³ÌÐò¿ª·¢
e)ϵͳÓëÊý¾Ý¹ÜÀí
f)²âÊÔÓë°æ±¾¿ØÖÆ
¶þ¡¢ ÍøÕ¾×鿪·¢¼òÃ÷Á÷³Ì
Èý¡¢ ¿ª·¢¹¤¾ßÓë»·¾³
a)·þÎñÆ÷ÅäÖÃ
i. WEB·þÎñÆ÷£º FreeBSD6.1+Apache2.0+PHP5.0£¬SVN°æ±¾¿ØÖÆ·þÎñ(½ö²âÊÔ»ú)¡£
ii.Êý¾Ý¿â·þÎñÆ÷£º WIN2003 server+SQL server 2000+MySQL5.0 ......
תÔØhttp://www.php100.com/html/webkaifa/PHP/PHPyingyong/2009/1115/3523.html
1.Èç¹ûÒ»¸ö·½·¨Äܱ»¾²Ì¬£¬ÄǾÍÉùÃ÷ËûΪ¾²Ì¬µÄ£¬ËٶȿÉÌá¸ß1/4;
2.echoµÄЧÂʸßÓÚprint,ÒòΪechoûÓзµ»ØÖµ£¬print·µ»ØÒ»¸öÕûÐÍ;
3.ÔÚÑ»·Ö®Ç°ÉèÖÃÑ»·µÄ×î´ó´ÎÊý£¬¶ø·ÇÔÚÔÚÑ»·ÖÐ;
4.Ïú»Ù±äÁ¿È¥ÊÍ·ÅÄڴ棬ÌرðÊÇ´óµÄÊý×é;
5.±ÜÃâÊ ......
<script language="javascript" type="text/javascript">
function checkbox()
{
var str=document.getElementsByName("chk");
var objarray=str.length;
var chestr="";
for (i=0;i<objarray;i++)
{
if(str[i].checked == true)
{
chestr+="1";
} else{
chestr+="0";
}
}
document.ge ......
½ÓÊÕxml:
$xml = file_get_contents('php://input');
·¢ËÍ(post):
$xml_data = <xml>...</xml>";
$url = http://dest_url;
$header[] = "Content-type: text/xml";//¶¨Òåcontent-typeΪxml
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_ ......