ÓйØphpǰ;Èý
¹ØÓÚPHPµÄǰ;£¨Èý£© £¨À´×Ô±¾Õ¾µÄÏûÏ¢£©
6.PHPµÄ¼òÒªÀúÊ·
PHP×î³õ×÷ΪһÖÖÓÃPerlд³ÉµÄ¼òµ¥Ð¡ÇɵÄCGI¹¤¾ß£¬±»³ÆΪ“¸öÈËÖ÷Ò³¹¤¾ß£¨Personal Home Page Tools£©”£¬ºóÀ´¸Ä³ÆΪ“¸öÈËÖ÷Ò³¹¹½¨¹¤¾ßÏ䣨Personal Home Page Construction Kit£©”¡£
Ò²Ôø½Ð×ö“רҵÖ÷Ò³¹¤¾ß£¨Professional Home Pages£©”£¬ÏÖÔÚ×îеÄÃû³ÆÊÇ
“PHP³¬Îı¾Ô¤´¦ÀíÆ÷£¨PHP Hypertext Pre-Processor£©”
ÁíÍ⻹ÓÐÒ»ÖÖ¹¤¾ß£¬¿ÉÒԷdz£¼òµ¥µÄ°ÑSQL²éѯÓï¾äǶÈëWebÒ³Ãæµ±ÖС£ÕâÖÖ¹¤¾ß»ù±¾ÉÏ¿ÉÒÔ¿´×÷ÊǽâÎöSQL²éѯÓï¾ä£¬²¢ÔÚ´Ë»ù´¡ÉϷdz£ÈÝÒ׵Ĵ´½¨±íµ¥ºÍ±í¸ñµÄÁíÒ»ÖÖCGI¹¤¾ß¡£ÕâÖÖ¹¤¾ß½Ð×öFI£¨Form Interpreter£¬±íµ¥½âÊÍÆ÷£©¡£
PHP/FI2.0³¹µ×ÖØдÁËÕâÁ½¸ö°ü£¬²¢ºÏ²¢³ÉÒ»¸öµ¥¶ÀµÄ³ÌÐò¡£×îÖÕ·¢Õ¹³ÉÒ»ÖÖǶÔÚHTMLÎļþµ±Öеļòµ¥µÄ³ÌÐòÓïÑÔ¡£PHPͨ¹ýÖ±½ÓÔÚHTMLÎļþÖзÅÖüòµ¥µÄ½Å±¾
ʹµÃ²»ÔÙÐèÒª´´½¨´óÁ¿Î¢Ð¡µÄPerl CGI³ÌÐò¡£ÒòΪÃâÈ¥Á˶à´Îµ÷ÓÃPerl³ÌÐòµÄ¸ººÉ£¬ËùÒÔ´ó´óÌá¸ßÁËÄãµÄWebÒ³ÃæµÄ×ÜÌåÐÔÄÜ¡£´ó´óÌá¸ßÁËÄãµÄWebÒ³ÃæµÄ×ÜÌåÐÔÄÜ¡£ ¶øÇÒͨ¹ý°Ñ¹¹³ÉWebÒ³ÃæµÄËùÓÐ×é¼þ·ÅÔÚÒ»¸öµ¥¶ÀµÄHTMLÎļþÖУ¬Ê¹µÃ´óÐÍÕ¾µãµÄ¹ÜÀí±äµÄ¸üΪÈÝÒס£ ÓÉÓÚ°üÀ¨Á˶Ը÷ÖÖÊý¾Ý¿âµÄÖ§³Ö£¬¿ÉÒԷdz£ÈÝÒ׵Ŀª·¢»ùÓÚÊý¾Ý¿âµÄWebÒ³Ãæ¡£ Ðí¶àÈ˶¼ÈÏΪ£¬ÕâÖÖ·½Ê½±È´´½¨·ÖÀëµÄHTMLºÍCGIÎļþ¸üΪ¼òµ¥¡£
ÏÖÔÚ£¬PHP/FIÓÖ±»ÖØÐÂÃüÃûΪPHP¡£
7.Ò»¸ö¼òµ¥µÄÀý×Ó
¼ÙÉèÄãÓÐÕâÑùÒ»¸ö±íµ¥£º
ÄãµÄdisplay.htmlÎļþ¿ÉÒÔÕâÑùÀ´ÏÔʾ±íµ¥ËùÌá½»µÄÄÚÈÝ£º
ÕâÊÇÄÇôµØÈÝÒ×£¡ PHP×Ô¶¯ÎªÃ¿Ò»¸ö±íµ¥ÊäÈëÓò´´½¨Á˱äÁ¿¡£Äã¿ÉÒÔÖ±½ÓÔÚ
ACTIONÖ¸ÏòµÄÎļþÖÐʹÓÃÕâЩ±äÁ¿¡£
Ò»µ©¸ãÇå³þÁ˱äÁ¿Ê¹Ó÷½·¨£¬ÄÇôÏÂÒ»²½Äã±ã¿ÉÒÔÔÚÒ³ÃæÖбàдһЩÂß¼Á÷³ÌÁË¡£ ÀýÈ磬ÄãÏë¸ù¾Ý²»Í¬µÄÓû§ÊäÈëÀ´ÏÔʾ²»Í¬µÄÏûÏ¢£¬¾Í¿ÉÒÔʹÓÃif/elseÓï¾ä¡£ °ÑÉÏÃæµÄÀý×Ó¸ÄÒ»¸Ä£¬ÎÒÃǾͿÉÒÔ¸ù¾ÝÓû§ÊäÈëµÄÄêÁä×ö²»Í¬µÄÏÔʾÁË£º
if($age>50);
echo "Hi $name, you are ancient!
";
elseif($age>30);
echo "Hi $name, you are very old!
";
else;
echo "Hi $name.";
endif;
?>
PHPÌṩÁËÒ»Ì׷dz£Ç¿´óµÄ½Å±¾ÓïÑÔ£¬ËüÄÜ×öµÄÒª±ÈÉÏÃæÕâ¸ö¼òµ¥µÄÀý×ÓÒª¶àµÄ¶à¡£¿É²Î¼ûPHP½Å±¾ÓïÑÔ²¿·Ö£¬»ñÈ¡¸ü¶àÐÅÏ¢¡£
ÄãÒ²¿ÉÒÔÓÃPHPÀ´ÅäÖÃÒ³ÃæµÄ·ÃÎÊȨÏÞ¡£ÕâÊÇͨ¹ýÒ»¸öÄÚ½¨µÄÅäÖýçÃæÀ´ÊµÏֵġ£±È·½Ëµ£¬Äã¿ÉÒÔÖ¸¶¨À´×ÔÌض¨µÄÓòµÄÓû§²ÅÄÜ·ÃÎÊÄãµÄÒ³Ãæ¡£»òÕߣ¬ÄãÒ²¿ÉÒÔ´´½¨Ò»¸ö¹æÔò£¬Ó
Ïà¹ØÎĵµ£º
1¡¢mysql_connect()-½¨Á¢Êý¾Ý¿âÁ¬½Ó
¸ñʽ£º
resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
Àý£º
$conn = @mysql_connect(”localhost”, “username”, “password”) or dir(”²»ÄÜÁ¬½Óµ½Mysql Server” ......
Ä¿Ç°£¬×î³£ÓõÄÈýÖÖ¶¯Ì¬ÍøÒ³ÓïÑÔÓÐASP(Active Server Pages),JSP(Java Server Pages),
PHP (Hypertext Preprocessor)¡£
¼ò ½é
¡¡¡¡ASPÈ«ÃûActive Server & ......
isset() ¡¾1¡¿
Returns TRUE if var
exists and has value other
than NULL, FALSE otherwise.
ÊäÈë¿ÉÒÔÊǶà¸ö±äÁ¿£¬Ö»ÓÐËùÓеıäÁ¿ÎªÕæµÄʱºò£¬·µ»ØÕæ
empty()¡¾2¡¿
Returns FALSE if var
has a non-empty
and non-zero value.
The following things are considered to be empty:
"" (an em ......
²»Öª²»¾õ£¬5Ô¹ýÁË´ó°ëÁË£¬Ïë±£³Öÿ¸öÔÂÖÁÉÙ¸ø Blog Ìí¼ÓһЩÐÂÏʵÄÎÄÕ£¬Ò²Ëæ±ã¸ø×Ô¼ºµÄ career ¹ì¼£×öÒ»¸ö¼Ç¼£¬ÓÚÊÇÌá±Ê£¬ºÇºÇ~ ½ñÌìÒª½éÉÜÒ»ÏÂʯͷ×îеÄ×÷Æ· Hush Framework£¬Õâ¸ö¿ò¼ÜÊÇÎÒÕâÁ½¸öÔµÄÐÄѪ֮×÷£¬±¾ÈË»¹ÊDZȽÏÂúÒâµÄ£¬ÒÔÏ»á¸ø´ó¼Ò½éÉÜһЩÕâ¸ö¶«¶«µÄÁÁµã¡£Õâ¸ö×÷Æ·µÄ±¾ÒâÊÇΪ¹«Ë¾ÈÕºóµÄÓ¦Óÿª·¢Ìṩһ¸ö ......
¹ØÓÚPHPµÄǰ;£¨¶þ£© £¨À´×Ô±¾Õ¾µÄÏûÏ¢£©
3.2ÔÚWindows 95/98/NT/2000ÉÏ¿ìËÙ°²×°Apache Web·þÎñÆ÷£¨10ÃëÖÓ£©
ÔÚWindowsÉÏÔËÐÐPHP£¬ÄãÐèÒªÒ»¸öWeb·þÎñÆ÷£¬Äã¿ÉÒÔʹÓÃ΢ÈíµÄIIS£¬Ò²¿ÉÒÔʹÓÃÃâ·ÑµÄApache ¡£ÒòΪ¿ÉÒÔͨ¹ýApacheµÄ°²×°Îļþsetup.exe½øÐа²×°£¬¿ÉÒÔΪÄã½ÚÊ¡Ðí¶àʱ¼ä¡£
PHPTtriadÊÇÒ»¸ö°üÀ¨Apache¡¢PHP¡¢MySQ ......