PHP»ù±¾Óï·¨£¨°Ë£©—— ±íµ¥´¦Àí
±íµ¥ºÍÓû§ÊäÈë
PHP ±íµ¥´¦Àí
±íµ¥ÊµÀý£º
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
ÉÏÃæµÄ HTML Ò³ÃæÊµÀý°üº¬ÁËÁ½¸öÊäÈë¿òºÍÒ»¸öÌá½»°´Å¥¡£µ±Óû§Ìîд¸Ã±íµ¥²¢µ¥»÷Ìá½»°´Å¥Ê±£¬±íµ¥µÄÊý¾Ý»á±»ËÍÍù "welcome.php" Õâ¸öÎļþ¡£
"welcome.php" ÎļþÀàËÆÕâÑù£º
<html>
<body>
Welcome <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old.
</body>
</html>
ÉÏÃæÕâ¸ö½Å±¾µÄÊä³öÑù±¾ÀàËÆÕâÑù£º
Welcome John.
You are 28 years old.
ÎÒÃǽ«ÔÚÏÂÒ»Õ½âÊÍ PHP $_GET ºÍ $_POST¡£
±íµ¥ÑéÖ¤
Ó¦¸ÃÔÚÈκοÉÄܵÄʱºò¶ÔÓû§ÊäÈë½øÐÐÑéÖ¤¡£¿Í»§¶ËµÄÑéÖ¤Ëٶȸü¿ì£¬²¢ÇÒ¿ÉÒÔ¼õÇá·þÎñÆ÷µÄ¸ºÔØ¡£
²»¹ý£¬ÈκÎÁ÷Á¿ºÜ¸ßÒÔÖÁÓÚ²»µÃ²»µ£ÐÄ·þÎñÆ÷×ÊÔ´µÄÕ¾µã£¬Ò²ÓбØÒªµ£ÐÄÕ¾µãµÄ°²È«ÐÔ¡£Èç¹û±íµ¥·ÃÎʵÄÊÇÊý¾Ý¿â£¬¾Í·Ç³£ÓбØÒª²ÉÓ÷þÎñÆ÷¶ËµÄÑéÖ¤¡£
ÔÚ·þÎñÆ÷ÑéÖ¤±íµ¥µÄÒ»Öֺõķ½Ê½ÊÇ£¬°Ñ±íµ¥´«¸øËü×Ô¼º£¬¶ø²»ÊÇÌø×ªµ½²»Í¬µÄÒ³Ãæ¡£ÕâÑùÓû§¾Í¿ÉÒÔÔÚͬһÕÅ±íµ¥Ò³ÃæµÃµ½´íÎóÐÅÏ¢¡£Óû§Ò²¾Í¸üÈÝÒ×·¢ÏÖ´íÎóÁË¡£
Ïà¹ØÎĵµ£º
http://blog.s135.com/read.php/142.htm
¡¡¡¡×î½üÔÚдPHP³ÌÐòʱ£¬ÐèҪʹä¯ÀÀÆ÷ÔÚhttpsºÍhttpÖ®¼äת»¯£¬ÉÏÍøËÑË÷Ïà¹ØÐÅÏ¢£¬ÎÞÄÎÖ»ÓÐ×î½üÔÚдPHP³ÌÐòʱ£¬ÐèҪʹä¯ÀÀÆ÷ÔÚhttpsºÍhttpÖ®¼äת»¯£¬ÉÏÍøËÑË÷Ïà¹ØÐÅÏ¢£¬ÎÞÄÎÖ»ÓÐһƪ½éÉÜÓÃASPʵÏÖ“ÔÚhttpºÍhttpsÖ®¼äת»¯”µÄÎÄÕ£¬ÓÚÊÇÖ»ºÃÐÐдÁËÓÃPHPʵÏÖhttpÓëhttpsת» ......
ÒÔÏÂÊDZ¾È˵ÄÉèÖÃÎļþ£¬Ï£Íû¶Ô´ó¼ÒÓÐÓãº
£¨×¢£º°æ±¾ÎªVIM7ÒÔÉÏ£©
£¨ÔÙ×¢£ºCtrl+x,Ctrl+o×Ô¶¯²¹È«£»Ctrl+n±äÁ¿²¹È«£©
£¨¼ÌÐø×¢£ºÏȽ«Îļþ±£´æÎª.php²Å¿ÉʹÓÃ×Ô¶¯²¹È«£¬Èç¹ûÏë¸ü»»Óï·¨Ìáʾ£¬¿ÉÒÔÑ¡Ôñ“Óï·¨->Ôڲ˵¥ÖÐÏÔʾÎļþÀàÐÍ->ÏëÓõÄÓïÑÔ,¶àµÄÏÅÈË£©
ĬÈÏÖ§³ÖµÄÓïÑÔÌáʾÓÐ:
C,CSS,html,javascript,php, ......
1)
°²×°Apache/2.2.14 ºÍ PHP/5.2.12 Ö®ºó£¬ÖØÐÂÆô¶¯Apache£¬Æô¶¯Ê§°Ü¡£²éÁËһЩ×ÊÁÏ£¬»ù±¾Éϸø³öµÄ½¨ÒéÊǽûµôExtension¡£ÎÒ¾Í×°ÁËÒ»¸öExtesion Mysqli¡£
ÐÞ¸Äphp.ini ×¢Ê͵ôÕâÒ»ÐУ¬¹ûÈ»ÉúЧ¡£
[PHP_MYSQLI]
;extension=php_mysqli.dll
°²×°Íêmysql£¬ÔÙÖØÐÂenableÕâ¸öÅäÖþͺÃÁË£¬¹À¼ÆÊÇÒÀÀµÄ³Ð©mysqlµÄ¿â¡£
......
switch Óï¾ä
Èç¹ûÄúÏ£ÍûÓÐÑ¡ÔñµØÖ´ÐÐÈô¸É´úÂë¿éÖ®Ò»£¬ÇëʹÓà Switch Óï¾ä¡£Ê¹Óà Switch Óï¾ä¿ÉÒÔ±ÜÃâÈß³¤µÄ if..elseif..else ´úÂë¿é¡£
Óï·¨
switch (expression)
{
case label1:
code to be executed if expression = label1;
break;
case label2:
code to be executed if expressio ......
Ñ»·Óï¾ä
ÔÚÄú±àд´úÂëʱ£¬Äú¾³£ÐèÒªÈÃÏàͬµÄ´úÂë¿éÔËÐкܶà´Î¡£Äú¿ÉÒÔÔÚ´úÂëÖÐʹÓÃÑ»·Óï¾äÀ´Íê³ÉÕâ¸öÈÎÎñ¡£
ÔÚ PHP ÖУ¬ÎÒÃÇ¿ÉÒÔʹÓÃÏÂÁÐÑ»·Óï¾ä£º
while
Ö»ÒªÖ¸¶¨µÄÌõ¼þ³ÉÁ¢£¬ÔòÑ»·Ö´ÐдúÂë¿é
do...while
Ê×ÏÈÖ´ÐÐÒ»´Î´úÂë¿é£¬È»ºóÔÚÖ¸¶¨µÄÌõ¼þ³ÉÁ¢Ê±Öظ´Õâ¸öÑ»·
for
Ñ»·Ö´ÐдúÂë¿éÖ¸¶¨µÄ´ÎÊý
foreach
¸ù ......