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

µÚÒ»¸öphpÍøÕ¾µÄһЩÐĵúÍÌå»á

ÏÈ˵ÏÂÔÚ×öµÄ¹ý³ÌÖÐÓöµ½µÄһЩÎÊÌ⣬ÒÔ¼°½â¾öµÄ·½·¨°É
1.¹ØÓÚÊéд´íÎó
×ʼ×öµÄÊÇÒ»¸öµÇ½ģ¿é£¬ÔڵǽÑéÖ¤µÄʱºò£¬Ê¹ÓÃ$_POST½ÓÊյIJÎÊý£¬È»ºóÔÚÑéÖ¤µÄʱºò£¬È´ÔõôҲ½ÓÊÕ²»µ½ÕâÁ½¸öÖµ£¬ºóÀ´²Å·¢ÏÖ$_POSTд´íÁË£¬Ð´³É$POST  ÉÙ¸öÏ»®Ïߣ¬½á¹ûÎÞ·¨ÕýÈ·µÄÑéÖ¤£¬ºÜÊÇÓôÃÆ¡£»¨Á˺ó¤Ê±¼ä£¬²ÅÕÒµ½Ô­Òò£¬¶øÇÒ»¹ÊÇÒ»¸öµÍ¼¶´íÎ󣬵±Ê±ÔÚûÓÐÕÒµ½Ô­ÒòµÄʱºò£¬·¢ÔÚÂÛ̳ÀïȺÀ¶¼ÈðïæÕÒÔ­Òò£¬µ±ÕÒµ½Ô­ÒòµÄʱºò£¬ºÜÊDzÑÀ¢£¬´ÓÄÇÒÔºó£¬ÔÙÓöµ½´íÎó£¬Îҷdz£µÄÉ÷ÖØ£¬ÏÈ´ÓÓï·¨Éϼì²é£¬Èç¹û±£ÖØÔÚÓ﷨ûÓдíÎóµÄÇ°ÌáÏ£¬Èç¹û»¹ÕÒ²»µ½Ô­Òò£¬ÔÙÈ¥ÎʱðÈË¡£
2.¾ÍÊÇÍ˳öÌøת¡£Ôڵǽ³É¹¦Ö®ºó£¬µãÍ˳öµÄʱºò£¬»áÌøµ½µÇ½½çÃ棬²¢Çå³ýsession¡£´úÂëÈçÏ£º
<a href="login.php?action=logout" target="_parent" onClick="return confirm('ÄúÈ·¶¨ÒªÍ˳öÂð£¿');">Í˳ö</a>
ºǫ́ÆäʵÊÇÒ»¸öframeset¿ò¼Ü£¬¶øÍ˳öÁ¬½Ó¾ÍÔÚleft.phpÀÎÒµÄÕâ¸öÍ˳öÑéÖ¤ÊÇдÔÚleft.phpÀïµÄ£¬
±ÈÈç:
if($_GET[action]==logout){
     //×öһЩÇåÀísession²Ù×÷
}
¿ÉÊÇÕâʱºò£¬session²¢Ã»ÓÐÇå³ý£¬Õâ¸öÍ˳öÖ»ÊÇÍê³ÉÁËÒ»¸ö³¬Á¬½ÓµÄ×÷Óã¬Á¬½Óµ½ÁËlogin.phpÒ³Ã棬ºóÀ´²ÅŪÃ÷°×£¬Õâ¸ö³¬Á¬½ÓÊÇÁ¬½ÓµÄlogin.php£¬ËùÒÔÉÏÃæµÄÄǸöifÅжÏÓ¦¸ÃÊÇдÔÚlogin.phpÀ½ÓÊÕaction==logout£¬ÕâÑù²ÅÕýÈ·£¬¶øÎÒÈ´°ÑËüдÔÚÁËleft.phpÀïÁË£¬ËùÒÔ²ÅûÓгɹ¦¡£
3.ÔÙÏÂÀ´¾ÍÊÇÒ»¸öÂÒÂëµÄÎÊÌâÁË.
ÔÚconfig.phpÀÎÒÉèÖÃÁËset namesµÄ±àÂë¸ñʽÊÇuft-8£¬Ò³ÃæµÄmetaÀïÒ²ÊÇÉèÖõÄutf-8£¬Êý¾Ý¿âÀïÒ²ÊÇʹÓõÄutf-8µÄ±àÂ룬µ«ÊÇÒÀÈ»ÊdzöÏÖÂÒÂ룬ºóÀ´²Å·¢ÏÖ£¬set namesÕâºóÃæµÄutf-8 Ó¦¸Ãд³Éutf8   Æäʵº¬Ò嶼ÊÇÒ»ÑùµÄ£¬Ö»ÊÇmysql³ÆΪutf8  ¶øÍøÒ³³ÆËüΪutf-8,¾ÍÏñÒ»¸öÈË£¬ÓÐÒ»¸öÊéÃæµÄÃû×Ö£¬Ò²ÓÐÒ»¸öСʱºòµÄÈéÃû£¬Æäʵ¶¼ÊÇͬһ¸öÈË¡£
ÔÙÁíÒ»¸öÂÒÂëµÄÎÊÌâÊÇÔÚ·ÖÒ³µÄʱºò£¬ÎÒµÄÄǸö·ÖÒ³µ¼º½ÊÇ´ÓÍøÉÏÕҵġ£Ö±½ÓÄõ½³ÌÐòÖÐÓÃÁË£¬¿ÉÊÇÆæ¹ÖµÄʱºò£¬ÆäËüµÄ¶¼Õý³££¬Ö»ÓзÖÒ³µ¼º½ÊÇÂÒÂ룬ºóÀ´ÔÚÍøÉÏÕÒÁ˺ܶà×ÊÁÏ£¬¶¼²»ÊÇÌرðµÄÇå³þ.Ò»¸öż¶ûµÄ»ú»á£¬ÎÒÔÚ´ò¿ªÎÒµÄÄǸö·ÖÒ³º¯ÊýËùÔÚµÄÎļþµÄʱºò£¬·¢ÏÖÀïÃæÈ«ÊÇÂÒÂë²ÅÖªµÀ£¬ÉèÖóÉutf-8±àÂëÖ»ÊÇÆäÖÐÒ»²½£¬ÎļþÔÚ±£´æµÄʱºò£¬Ò²ÐèÒª±£´æ³Éutf-8µÄ±àÂë²Å¿ÉÒÔ£¬ÎÒת»»Ö®ºó£¬¾ÍÕý³£ÁË¡£
²»¹ýÓÐһЩÒÉÎÊ£¬¼ÙÈçÎÒʹÓõıàÂë²»ÊÇutf-8µÄ£¬Èç¹ûÊÇgbk»òÕßÊÇgb2312±àÂëµÄʱºò£¬Õâʱºò£¬ÔÚ±£´æÎļþÑ¡Ôñ±àÂëÊÇ·ñÒ²Óн²¾¿£¿
¹ØÓÚÂÒÂ룬


Ïà¹ØÎĵµ£º

[zz]Ò»¸ö³¬¼¶¼òµ¥µÄphpͶƱϵͳ£¬²»Ê¹ÓÃÊý¾Ý¿â

±¾ÎÄת×ÔÎҵIJ©¿Í£º(my.unix-center.net/~xiaoshe)
http://my.unix-center.net/~xiaoshe/2010/04/19/%E4%B8%80%E4%B8%AA%E8%B6%85%E7%BA%A7%E7%AE%80%E5%8D%95%E7%9A%84php%E6%8A%95%E7%A5%A8%E7%B3%BB%E7%BB%9F%EF%BC%8C%E4%B8%8D%E4%BD%BF%E7%94%A8%E6%95%B0%E6%8D%AE%E5%BA%93/
´ÓÍøÉÏ·¢ÏÖµÄÒ»¸ö³¬¼¶¼òµ¥µÄ»ùÓÚphpµÄͶ ......

phpµÄËæ»úÅÅÐò


Èç¹ûÔÚPHPÖÐҪʵÏÖ¶Ô²ÊƱµÄʵÏÖÓ¦¸ÃÔõô×öÄØ£¿
¸ù¾ÝÇ°Ã漸ÕÅÌáµ½µÄ¼¸ÖÖÊý×éÓ÷¨£ºPHP˳ÐòÅÅÐò£¬PHP——¶þ·Ö·¨²éÕÒÊý¾Ý£¬ÔÚPHPÊý×éÖÐËÑË÷Ö¸¶¨µÄÖµ£¬PHPÊý×éµÄÈëÕ»Óë³öÕ»£¬ºÏ²¢£Ð£È£ÐÊý×飬Äܹ»ÊµÏÖ²ÊƱ¹¦ÄÜÂð£¿
´ð°¸ÊÇ£º¿ÉÒÔ¡£µ«ÊÇÕâÑù×öµÄ´úÂë»á±äµÃºÜÓ·Öס£
Õâʱ£¬ÎÒ¿´µ½ÁËphpµÄshuffleº¯Êý¡£shuffleº¯Êý¿É ......

PHP $_SERVER[''] ²ÎÊýÏê½â

$_SERVER['PHP_SELF'] #µ±Ç°ÕýÔÚÖ´Ðнű¾µÄÎļþÃû£¬Óë document rootÏà¹Ø¡£
$_SERVER['argv'] #´«µÝ¸ø¸Ã½Å±¾µÄ²ÎÊý¡£
$_SERVER['argc'] #°üº¬´«µÝ¸ø³ÌÐòµÄÃüÁîÐвÎÊýµÄ¸öÊý£¨Èç¹ûÔËÐÐÔÚÃüÁîÐÐģʽ£©¡£
$_SERVER['GATEWAY_INTERFACE'] #·þÎñÆ÷ʹÓÃµÄ CGI ¹æ·¶µÄ°æ±¾¡£ÀýÈ磬“CGI/1.1”¡£
$_SERVER['SERVER_ ......

PHPÖÐthis self parentÈý¸öÓ¦ÓÃ˵Ã÷

  this,self,parentÈý¸ö¹Ø¼ü×ÖÖ®¼äµÄÇø±ð¡£´Ó×ÖÃæÉϱȽϺÃÀí½â,·Ö±ðÊÇÖ¸Õâ¡¢×Ô¼º¡¢¸¸Çס£ÎÒÃÇÏȽ¨Á¢¼¸¸ö¸ÅÄî,ÕâÈý¸ö¹Ø¼ü×Ö·Ö±ðÊÇÓÃÔÚʲôµØ·½ÄØ?ÎÒÃdzõ²½½âÊÍÒ»ÏÂ,thisÊÇÖ¸Ïòµ±Ç°¶ÔÏóµÄÖ¸Õë(¹ÃÇÒÓÃCÀïÃæµÄÖ¸ÕëÀ´¿´°É),selfÊÇÖ¸Ïòµ±Ç°ÀàµÄÖ¸Õë,parentÊÇÖ¸Ïò¸¸ÀàµÄÖ¸Õë¡£ÎÒÃÇÕâÀïƵ·±Ê¹ÓÃÖ¸ÕëÀ´ÃèÊö£¬ÊÇÒòΪûÓиüºÃµÄÓï ......

ÓÃPHPʵÏÖ·ÉÐÅapi½Ó¿Ú·¢·ÉÐŶÌÐÅ

²»¹ýÕâ¸ö²»ÄܺͷÉÐÅ¿Í»§¶ËͬʱµÇ¼£¬¶þÕßÖ»ÄܵÇÒ»¸ö£¬Ö»Òª´úÂëÔÚdwÀï´ò¿ª£¬¿Í»§¶Ë¾ÍµôÁ˺ǺÇ~~~
<?php
/*
* Created on 2010-4-18
* MiaoPengFei
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$data["username"] = ;//ÕâÀïÌ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ