Php+Mysql×¢ÈëרÌâ
Php×¢Èë¹¥»÷ÊÇÏÖ½ñ×îÁ÷ÐеĹ¥»÷·½Ê½£¬ÒÀ¿¿ËüÇ¿´óµÄÁé»îÐÔÎüÒýÁ˹ã´óºÚÃÔ¡£
ÔÚÉÏÒ»Æڵġ¶php°²È«Óë×¢ÉäרÌâ¡·ÖÐÁÖ.linxÖ÷Òª½²ÊöÁËphp³ÌÐòµÄ¸÷ÖÖ©¶´£¬Ò²½²µ½ÁËphp£«mysql×¢ÈëµÄÎÊÌ⣬¿ÉÊǽ²µÄ×¢ÈëµÄÎÊÌâ±È½ÏÉÙ£¬ÈÃÎÒÃǸоõûÓо¡ÐËÊÇ°É.
OK,ÕâÒ»ÆÚÎÒ½«¸ø´ó¼Ò»ï×Ð×ÐϸϸµÄ´µÒ»´µphp£«mysql×¢È룬һ¶¨ÈÃÄãÂúÔضø¹éŶ£¨ËÈÓשͷÁ¨£¡£©¡£
±¾ÎÄÖ÷ÒªÊÇΪС²ËÃÇ·þÎñµÄ£¬Èç¹ûÄãÒѾÊÇÒ»Ö»ÀÏÄñÄØ£¬¿ÉÄÜijЩ¶«Î÷»á¸Ð¾õ±È½Ï·¦Î¶£¬µ«Ö»ÒªÄã×ÐϸµÄ¿´£¬Äã»á·¢ÏֺܶàÓÐȤµÄ¶«Î÷Ŷ¡£
ÔĶÁ´ËÎÄÄãÖ»ÒªÃ÷°×ÏÂÃæµÄÕâµã¶«Î÷¾Í¹»ÁË¡£
1.Ã÷°×php+mysql»·¾³ÊÇÈçºÎ´î½¨µÄ£¬ÔÚ¹âÅÌÖÐÎÒÃÇÊÕ¼´î½¨µÄÏà¹ØÎÄÕ£¬Èç¹ûÄú¶Ô´î½¨php+mysql»·¾³²»ÊǺÜÇå³þ£¬ÇëÏȲéÔÄ´ËÎÄ£¬ÔÚÉÏÒ»ÆÚµÄרÌâÖÐÒ²ÓÐËù½éÉÜ¡£
2.´ó¸ÅÁ˽âphpºÍapacheµÄÅäÖã¬Ö÷ÒªÓõ½php.iniºÍhttpd.conf
¶ø´ËÎÄÎÒÃÇÖ÷ÒªÓõ½µÄÊÇphp.iniµÄÅäÖá£ÎªÁË°²È«Æð¼ûÎÒÃÇÒ»°ã¶¼´ò¿ªphp.iniÀïµÄ°²È«Ä£Ê½£¬¼´ÈÃsafe_mode = On£¬»¹ÓÐÒ»¸ö¾ÍÊÇ·µ»ØphpÖ´ÐдíÎóµÄdisplay_errors Õâ»á·µ»ØºÜ¶àÓÐÓõÄÐÅÏ¢£¬ËùÒÔÎÒÃÇÓ¦¸Ã¹Ø±ÕÖ®£¬
¼´ÈÃdisplay_errors£½off ¹Ø±Õ´íÎóÏÔʾºó£¬phpº¯ÊýÖ´ÐдíÎóµÄÐÅÏ¢½«²»»áÔÙÏÔʾ¸øÓû§¡£
ÔÚphpµÄÅäÖÃÎļþphp.iniÖл¹ÓÐÒ»¸ö·Ç³£ÖØÒªµÄÅäÖÃÑ¡Ïîmagic_quotes_gpc£¬¸ß°æ±¾µÄĬÈ϶¼ÊÇmagic_quotes_gpc£½On£¬Ö»ÓÐÔÚÔÀ´µÄ¹Å¶¼¶µÄphpÖеÄ
ĬÈÏÅäÖÃÊÇmagic_quotes_gpc£½Off£¬¿ÉÊǹŶµÄ¶«Î÷Ò²ÓÐÈËÓõÄŶ£¡
µ±php.iniÖÐmagic_quotes_gpc£½OnµÄʱºò»áÓÐʲôÇé¿ö·¢ÉúÁ¨£¬²»Óþª»Å£¬ÌìÊÇËú²»ÏÂÀ´µÄÀ²£¡ËüÖ»ÊÇ°ÑÌá½»µÄ±äÁ¿ÖÐËùÓÐµÄ ’ (µ¥ÒýºÅ), “(Ë«ÒýºÅ), \ (·´Ð±Ïß) ºÍ ¿Õ×Ö·û»á×Ô¶¯×ªÎªº¬Óз´Ð±ÏßµÄתÒå×Ö·û£¬ÀýÈç°Ñ’±ä³ÉÁË\’,°Ñ\±ä³ÉÁË\\¡£
¾ÍÊÇÕâÒ»µã£¬ÈÃÎÒÃǺܲ»Ë¬Å¶£¬ºÜ¶àʱºòÎÒÃǶÔ×Ö·ûÐ͵ľÍÖ»ºÃ˵BYEBYEÁË£¬
µ«ÊDz»ÓÃÆøÄÙ£¬ÎÒÃÇ»¹ÊÇ»áÓк÷½·¨À´¶Ô¸¶ËüµÄ£¬ÍùÏ¿´¿©£¡
3.ÓÐÒ»¶¨µÄphpÓïÑÔ»ù´¡ºÍÁ˽âһЩsqlÓï¾ä£¬ÕâЩ¶¼ºÜ¼òµ¥£¬ÎÒÃÇÓõ½µÄ¶«Î÷ºÜÉÙ£¬ËùÒÔ³äµç»¹À´µÄ¼°Å¶£¡
ÎÒÃÇÏÈÀ´¿´¿´magic_quotes_gpc£½OffµÄʱºòÎÒÃÇÄܸÉЩɶ£¬È»ºóÎÒÃÇÔÙÏë°ì·¨¸ãÒ»¸ãmagic_quotes_gpc£½OnµÄÇé¿ö¹þ
Ò»£ºmagic_quotes_gpc£½OffʱµÄ×¢Èë¹¥»÷
magic_quotes_gpc£½OffµÄÇé¿öËäȻ˵ºÜ²»°²È«£¬Ð°汾ĬÈÏÒ²ÈÃ
magic_quotes_gpc£½OnÁË£¬¿ÉÊÇÔںܶà·þÎñÆ÷ÖÐÎÒÃÇ»¹·¢ÏÖmagic_quotes_gpc£½OffµÄÇé¿ö£¬ÀýÈçwww.qichi.*¡£
»¹ÓÐijЩ³ÌÐòÏñvbbÂÛ̳¾ÍËãÄãÅäÖÃmagic_quotes_gpc£½On
Ïà¹ØÎĵµ£º
1. ½éÉÜ
1.1. ±ê×¼»¯µÄÖØÒª**
±ê×¼»¯ÎÊÌâÔÚijЩ·½ÃæÉÏÈÃÿ¸öÈËÍ·Í´£¬ÈÃÈËÈ˶¼¾õµÃ´ó¼Ò´¦ÓÚͬÑùµÄ¾³µØ¡£ÕâÓÐÖúÓÚÈÃÕâЩ½¨ÒéÔÚÐí¶àµÄÏîÄ¿Ö⻶ÏÑݽø£¬Ðí¶à¹«Ë¾»¨·ÑÁËÐí¶àÐÇÆÚÖð×Ó×ÖÖð¾äµÄ½øÐÐÕùÂÛ¡£±ê×¼»¯²»ÊÇÌØÊâµÄ¸öÈË·ç¸ñ£¬Ëü¶Ô±¾µØ¸ÄÁ¼ÊÇÍêÈ«¿ª·ÅµÄ¡£
1.2. Óŵã
µ±Ò»¸öÏîÄ¿³¢ÊÔ×Å×ñÊع«Óõıê׼ʱ£¬»áÓÐÒÔϺô¦£ ......
1. »ù´¡Óï·¨
PHP µÄ½Å±¾¿éÒÔ <?php ¿ªÊ¼£¬ÒÔ ?> ½áÊø¡£Äú¿ÉÒÔ°Ñ PHP µÄ½Å±¾¿é·ÅÖÃÔÚÎĵµÖеÄÈκÎλÖá£
PHP ÖеÄÿ¸ö´úÂëÐж¼±ØÐëÒԷֺŽáÊø¡£·ÖºÅÊÇÒ»ÖÖ·Ö¸ô·û£¬ÓÃÓÚ°ÑÖ¸ÁÇø·Ö¿ªÀ´¡£
ÓÐÁ½ÖÖͨ¹ý PHP À´Êä³öÎı¾µÄ»ù´¡Ö¸Áecho ºÍ print¡£ÔÚÉÏÃæµÄÀý×ÓÖУ¬ÎÒÃÇʹÓÃÁË echo Óï¾äÀ´Êä³öÎı¾ "Hello World"¡£
Ô ......
<?
//http://www.jb51.net
class upLoad{
public $length; //ÏÞ¶¨Îļþ´óС
public $file; //ÅжϴËÀàÊÇÓÃÓÚͼƬÉÏ´«»¹ÊÇÎļþÉÏ´«
public $fileName; //ÎļþÃû
public $fileTemp; //ÉÏ´«ÁÙʱÎļþ
public $fileSize; //ÉÏ´«Îļþ´óС
public $error; //ÉÏ´«ÎļþÊÇ·ñÓдí,php4ûÓÐ
public $fileType; //ÉÏ ......
°æ±¾£ºapache_2.2.6-win32-x86-no_ssl
Ö±½Ó°´Ä¬ÈÏ°²×°£¬°²×°Ê±Òª¹Ø±Õä¯ÀÀÆ÷¸úÏÂÔØÈí¼þ£¬·ñÔò°²×°Íê³Éºó·þÎñÆ÷²»ÄÜÆô¶¯£¬±¨²»ÄÜ°ó¶¨80¶Ë¿ÚµÄ´íÎó¡£Æô¶¯ºóÔÚµØÖ·À¸ÖÐÊäÈë“http://localcast/”»ò“http://127.0.0.1/”£¬Èç¹û¿ÉÒÔ¿´µ½"It Works"£¬ËµÃ÷°²×°³É¹¦¡£
Èç¹ûÐèÒª¸ü¸ÄĬÈÏ·¾¶£¬´ò¿ª“C:\P ......
Ò»¡¢ ¿ª·¢³ÉÔ±
a)ÏîÄ¿Ö÷¹Ü
b)Ò³ÃæÃÀ¹¤
c)Ò³Ã濪·¢
d)·þÎñ¶Ë³ÌÐò¿ª·¢
e)ϵͳÓëÊý¾Ý¹ÜÀí
f)²âÊÔÓë°æ±¾¿ØÖÆ
¶þ¡¢ ÍøÕ¾×鿪·¢¼òÃ÷Á÷³Ì
Èý¡¢ ¿ª·¢¹¤¾ßÓë»·¾³
a) ·þÎñÆ÷ÅäÖÃ
i. WEB·þÎñÆ÷£º FreeBSD6.1+Apache2.0+PHP5.0£¬SVN°æ±¾¿ØÖÆ·þÎñ(½ö²âÊÔ»ú)¡£
ii. Êý¾Ý¿â·þÎñÆ÷£º WIN2003 server+SQL server 2000+ ......