PHPÊý¾Ý¿â³éÏó²ã
±¾ÕÂ×ÅÖؽ²ÊöPHPÊý¾Ý¿â³éÏó²ãÓëÊý¾Ý¿â³éÏóÀà¡£
Ä¿Ç°£¬ÔÚPHPµÄÍøÕ¾¼°ÖÚ¶àÊé¼®ÖУ¬ºÜÉÙ½²µ½Êý¾Ý¿â³éÏó²ã£¬ ÓеÄPHP¿ª·¢ÕßËäÈ»ÒÑ×öÁ˼¸Ä꿪·¢¹¤×÷£¬µ«ËƺõҲûÓÐÒâʶµ½ËüµÄ ´æÔÚ¡£
ºÜ¶àÈ˲¢²»Àí½âÊý¾Ý³éÏóµÄÖØÒªÐÔ£¬Ò²²» Á˽âmysql»òmysqliÀ© Õ¹ÓëPDOµÄÇø±ð£¬PDOÓëADODBÓÖÓÐʲôÇø±ð¡£
ÔÚ±¾ÕÂÖн«½²ÊöÒÔÏÂÄÚÈÝ£¬Í¨¹ýѧϰ£¬ÉÏÃæµÄÎÊÌⶼ»áÓÈжø½â¡£
ØʹÓÃÊý¾Ý¿â³éÏó²ãµÄÔÒò£»
ØÊý¾Ý¿â³éÏó²ãµÄ·¢Õ¹£»
ØһЩÁ÷ÐÐгéÏó²ãµÄ½éÉÜ£»
ØPDOÊý¾Ý¿â³éÏó²ã¿ª·¢¼¼Êõ£»
ØADODBÊý¾Ý¿â³éÏó²ã¿ª·¢¼¼Êõ¡£
17.1ʲôÊÇÊý¾Ý¿â³éÏó²ã
ʹÓÃÊý¾Ý¿â³éÏó²ã£¬Òâζ×ŵ±´ÓÒ»¸öÊý¾Ý ¿âϵͳÏòÁíÒ»¸öÊý¾Ý¿âϵͳǨÒÆʱ£¬¼¸ºõ²»Óøü¸ÄÌ«¶àµÄ³ÌÐò´úÂ룬È罫MS SQL ServerǨÒƵ½MySQL¡£
Ê×ÏÈ£¬´úÂë¹æ»®±ØÐë¹æ·¶£¬¼´Õû¸öϵͳʹ ÓÃͬһ¸öÊý¾Ý¶ÔÏóʵÀý£¬²¢ÇÒʹÓÃͬһ¸ö½ÏºÃµÄÊý¾Ý¿â³éÏó²ã¡£Èç¹ûÓÐÒ»ÌìÓà »§ÒªÇó½«OracleÇÐ »»µ½MySQL£¬ÔòÖ»Ðè Òª¸Ä±äϵͳµÄÅäÖÃÎļþ¼´¿É¡£
ÔÚµ±½ñ¹¤ÒµÁìÓòÖУ¬Ã¿¸öÊý¾Ý¿â¿ª·¢ÉÌÈç ΢Èí¡¢Oracle¡¢MySQL£¬¶¼ÓÐ×Ô¼ºµÄÒ»Ì×SQL±ê×¼£¬ËüÃÇÉù³ÆÊÇ°´ÕÕANSI SQL92±ê×¼¶øÔö¼Ó×Ô¼ºµÄÌØÐÔ£¬ÒÔ´ï µ½Â¢¶Ï»òÕ¼ÁìÊг¡µÄÄ¿µÄ¡£
ÓÅÐãµÄÊý¾Ý¿â³éÏó²ã£¬»á¸ù¾ÝÎÒÃÇÏÖÔÚʹ ÓõÄÊý¾Ý¿â×Ô¶¯µ÷ÕûһЩSQLÐÔÄÜ¡£µ±Ã»ÓÐʹÓÃÊý¾Ý¿â±¾ÉíÌض¨µÄÌØÐÔʱ£¬¾Í²»±Ø¸ü¸ÄÌ«¶àµÄÊý¾Ý¿âÁ¬½ÓºÍÊý¾Ý¿âSQL²éѯ¡£
ʹÓÃÊý¾Ý¿â³éÏó²ãµÄÆäËûºÃ´¦ÊÇ£ºÆäÐÔÖÊ¡¢¸ÅÄî¼ò»¯Á˸´ÔÓµÄÈÎÎñ¡£Òò´Ë£¬ÎÒÃDz»±Øѧϰij¸öÊý¾Ý¿âϵͳµÄÈ«ÐÂÌØ ÐÔ£¬¶øÖ»ÓÃÒ»¸ö±ê×¼µÄ³éÏó²ãµÄ´úÂëÌØÐÔ¼´¿É¡£
ËäÈ»ÕâÊÇÒ»ÖÖÀíÏ뻯£¬µ«Ëæ׿¼ÊõµÄ·¢ Õ¹£¬ÏàÐÅÊý¾Ý¿â³éÏó²ã»áΪÎÒÃÇ×ö¸ü¶àµÄÊ¡£
Ä¿Ç°£¬Ê¹ÓÃPHP½øÐв»Í¬µÄÊý¾Ý¿âϵͳ¿ª·¢£¬ÕâЩϵͳºÜ²»Ïà ͬ£¬¶øÐí¶àÊý¾Ý¿â³éÏó²ãÔÚPHPµÄ²ã´ÎÓÐËù²»Í¬£¬µ«±Ë´ËʹÓ÷½·¨Ï൱£¬ËüµÄ·¢Õ¹ÎÞÒÉ»áÌá¸ß¿ª·¢Ð§ÂÊ¡£
Ç뿴ͼ17-1£¬¹Û²ìÓÐÊý¾Ý³éÏó²ãºÍûÓÐÊý¾Ý³éÏó²ãµÄÇø ±ð¡£
Êý¾Ý¿â³éÏó²ãµÄÖ÷ÒªÐÔÄÜÖ¸±êÊÇËٶȣ¬ÓÉÓÚÊý¾Ý¿â³éÏó²ãÊǶîÍâµÄ´úÂë²ã£¬ÒòΪÃæÏò²»Í¬µÄ¼Ü¹¹ÓëÌåϵ£¬Òò´ËÓеÄЧÂʽϸߣ¬ÓÐ µÄÔòÏà¶Ô±È½ÏÂýЩ¡£
ÈçMetabaseÊÇPHPÖнÏÂýµÄÒ»¸öÊý¾Ý³éÏó²ã£¬ËüʹÓÃCÓïÑÔ±àд£¬ÒòΪËüµÄÉè¼ÆÓë¿ÉÒÆÖ²ÐÔ×î¸ß£¬¶øPDOºÍADODBÊǵ±½ñÊÀ½ç×î¿ìµÄÊý¾Ý¿â³éÏóÀà¡£
£¨b£©Ê¹ÓÃÊý¾Ý³éÏó²ãµÄPHP³ÌÐò¼Ü¹¹
ͼ17-1
Èç¹ûÄú·Ç³£¹ØעϵͳµÄЧÂʺÍÐÔÄÜ£¬Ôò¿É ÒÔ°´×Ô¼ºµÄ»ù×¼£¬ÉèÖÃÄ£Äâ»·¾³£¬±àд´úÂ룬²âÊÔÿ¸öÊý¾Ý¿â³éÏó²ã£¨ÀࣩµÄ ÐÔÄÜ¡£
17.2³£ÓõÄÊý¾Ý¿
Ïà¹ØÎĵµ£º
//1. Óû§ÃÜÂëÁùλÊý,²»ÄÜ´óÓÚÁùλ¶ø²»ÄÜСÓÚÁùÊý,Êý×ÖÖµÕýÔòΪ[0-9],ÇëÓÃPHPд³öÓм¸ÖÖ¿ÉÄÜÐÔ,²¢×ö±©Á¦Æƽâ;
function dePassword($pwd) {
$tmp = array('000000', '555555', '999999');
for ($i = 0; $i < 3; $i++) {
if ($pwd == $tmp[$i]) return $tmp[$i];
}
return $pwd < $tmp[1] ? getPwd(0, $pwd ......
ÔÎÄÁ´½Ó http://94798.blog.51cto.com/84798/261991
¶ÔÓÚ´ËÎÊÌâµÄ½â¾ö°ì·¨£¬´ò¿ªapache°²×°Â·¾¶ÖеÄhttp.confÎļþ£¬
ÕÒ´òÒÔÏÂÄÚÈÝ
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all & ......
PHP
Îļþ´¦Àí
fopen()
º¯ÊýÓÃÓÚÔÚ
PHP
Öдò¿ªÎļþ¡£
´ò¿ªÎļþ
fopen()
º¯ÊýÓÃÓÚÔÚ
PHP
Öдò¿ªÎļþ¡£
´Ëº¯ÊýµÄµÚÒ»¸ö²ÎÊýº¬ÓÐÒª´ò¿ªµÄÎļþµÄÃû³Æ£¬µÚ¶þ¸ö²ÎÊý¹æ¶¨ÁËʹÓÃÄÄÖÖģʽÀ´´ò¿ªÎļþ£º
<html>
<body>
<?php
$file=fopen("welcome.txt","r");
?>
......
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/2010/02/01/1-8/
PHP²»Ìṩ¿ç½Å±¾µÄÈ«¾Ö±äÁ¿£¬µ«ÊÇ£¬ÒòΪʵ¼ÊµÄÐèÒª£¬PHPÌṩÁËһЩÌØÊâµÄÈ«¾Ö±äÁ¿ÓÃÀ´ÊµÏÖÕâЩ²Ù×÷¡£
$_GET[]£º½ÓÊÕÀ´×ÔÓû§ä¯ÀÀÆ÷ʹÓÃGET·½·¨·¢Ë͵ıäÁ¿µÄÊý×é
$_POST[]£º½ÓÊÕÀ´×ÔÓû§ä¯ÀÀÆ÷ʹÓÃPOST·½·¨·¢Ë͵ıäÁ¿µÄÊý×é
$_COOKIE[]£º ......
1 ÉùÃ÷Ò»¸öÀà
class ÈË{
³ÉÔ±ÊôÐÔ£ºÐÕÃû¡¢ÐÔ±ð¡¢ÄêÁä¡¢Éí¸ß¡¢ÌåÖØ¡¢µç»°¡¢¼Òͥסַ
³ÉÔ±·½·¨£º¿ÉÒÔ¿ª³µ£¬ »á˵ӢÓ ¿ÉÒÔʹÓõçÄÔ
}
ÊôÐÔ£º
ͨ¹ýÔÚÀඨÒåÖÐʹÓùؼü×Ö“var”À´ÉùÃ÷±äÁ¿£¬¼´´´½¨ÁËÀàµÄÊôÐÔ,ËäÈ»ÔÚÉùÃ÷³ÉÔ±ÊôÐÔµÄʱºò¿ÉÒÔ¸ø¶¨³õʼֵ£¬ µ«ÊÇÔÚÉùÃ÷ÀàµÄʱºò¸ø³ÉÔ±ÊôÐÔ³õʼֵÊÇûÓбØÒªµÄ£¬±ÈÈ ......