µÚÒ»¸ö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±àÂëµÄʱºò£¬Õâʱºò£¬ÔÚ±£´æÎļþÑ¡Ôñ±àÂëÊÇ·ñÒ²Óн²¾¿£¿
¹ØÓÚÂÒÂ룬
Ïà¹ØÎĵµ£º
Ñ¿ÓêÔ´´PHPÐÂÎÅϵͳ½Ì³Ì£¨µÚÒ»°æ£©µÚÒ»½²£ºÓà phpmyadmin ½¨Á¢Êý¾Ý¿â
Ê×ÏȽ¨Á¢Ò»¸öÊý¾Ý¿â£¬ÃûΪ yayu ¡£ÔÚÕâ¸öÊý¾Ý¿âϽ¨Á¢Ò»¸öÊý¾Ý±í£¬ÃûΪ news ¡£ÏÂÃæ½øÈëÒ»¸öÖص㣬ÄǾÍÊÇÔÚ±í news Ͻ¨Á¢¸÷¸ö×ֶΡ£
ÄÇô£¬Ê²Ã´½Ð×Ö¶ÎÄØ£¿Í¨Ë׵㣬¾ÍÊÇÒ»ÀàÊÂÎïµÄ×ܳơ£±ÈÈç˵£¬ËùÓеÄÐÂÎÅ·¢±íʱ¼äÓÃÒ»¸öÃû´ÊÀ´´ú±í£¨´ÓżµÄ¾ÑéÀ´¿´ ......
$_SERVER['PHP_SELF'] #µ±Ç°ÕýÔÚÖ´Ðнű¾µÄÎļþÃû£¬Óë document rootÏà¹Ø¡£
$_SERVER['argv'] #´«µÝ¸ø¸Ã½Å±¾µÄ²ÎÊý¡£
$_SERVER['argc'] #°üº¬´«µÝ¸ø³ÌÐòµÄÃüÁîÐвÎÊýµÄ¸öÊý£¨Èç¹ûÔËÐÐÔÚÃüÁîÐÐģʽ£©¡£
$_SERVER['GATEWAY_INTERFACE'] #·þÎñÆ÷ʹÓÃµÄ CGI ¹æ·¶µÄ°æ±¾¡£ÀýÈ磬“CGI/1.1”¡£
$_SERVER['SERVER_ ......
ÓÃPHPʵÏÖÊÖ»ú¹éÊôµØ²éѯapi½Ó¿Ú£º
Ö÷ҪʹÓÃcurlʵÏÖ£¬ÐèÒª¿ªÆôphp¶ÔcurlµÄÖ§³Ö.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Conten ......
²»¹ýÕâ¸ö²»ÄܺͷÉÐÅ¿Í»§¶ËͬʱµÇ¼£¬¶þÕßÖ»ÄܵÇÒ»¸ö£¬Ö»Òª´úÂëÔÚ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"] = ;//ÕâÀïÌ ......