ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

5-4-1 ºô­¶Âà¦V

5-4-1 ºô­¶Âà¦V

5-4-1   ºô­¶Âà¦V
ºô­¶¸ê°T¡uLocation¡v¥iÂà¦V¨ä¥Lºô­¶©Îºô§}¡A³o­Ó¤èªk¤]´N©Ò¿×ªº¡y¦Û°ÊÃìµ²¡z¡G
header(¡§Locatiom: ±ý«e©¹ªººô§}¡¨);
¨Ò¦p¡G
  1. <?
  2. //¸ü¤Jºô­¶«á¡A¦Û°ÊÂà±µÁåµ²¦Ü»P¥Dºô­¶¦P¤@¥Ø¿ý¤¤ªºmessage.htmºô­¶
  3. header("Location: message.htm");
  4. //¸ü¤J¥Dºô­¶«á¡A¦Û°ÊÂà±µÁåµ²¦Ü¥Dºô­¶¤W¤@¼h¥Ø¿ý¤¤ªºex04_01.aspºô­¶
  5. header("Location: ../ch4/ex04_01.php");
  6. //¸ü¤J¥Dºô­¶«á¡A¦Û°ÊÂà±µÁåµ²¦Ü»P¥t¤@ºô§}¤¤ªººô­¶
  7. header("Location: http://www.twbts.com");
  8. ?>
½Æ»s¥N½X
header()¨ç¼Æ¥u¥i¥Î¦b©|¥¼¦³¥ô¦ó¸ê®Æ¿é¥X¦ÜÂsÄý¾¹¤§«e¤~¥i©I¥s¡C©|¥¼¦³¥ô¦ó¸ê®Æ¿é¥X¦ÜÂsÄý¾¹¤§«e¤~¥i©I¥s¡H³o¬O¤°»ò·N«ä¡H´N¬O¦bµ{¦¡¶}ºÝ²Å¸¹¡y<?¡z¤§«e³£¤£¯à¦³¥ô¦ó¸ê®Æ°Õ¡I¦p¤U¨Ò¡G¡]½d¨Òex05_10.php¡^
  1. <html><body>
  2. <%
  3. Response.Redirect "message.htm"
  4. %>
  5. </body>
  6. </html>
½Æ»s¥N½X
¤W¨Òµ²ªG±N·|Àò±o¤U¹Ïªº¿ù»~°T®§¡G

¹Ï5-15  ½d¨Òex05_16.php¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

¹ê°µ¾Ç²ß¡G
¦b¯d¨¥ªO½d¨Ò¤¤¡]go2php,message2.htm¡^¡A­Yªí³æ¤¤ªº¥ô¤@Äæ¦ì¨S¦³¶ñ¼g¸ê®Æ³£·|Åã¥Ü¡u©m¦W©Îemail©Î¯d¨¥,¥ô¦ó¤@Äæ¦ì¤£¥i¬°ªÅ¥Õ,½Ð­«·s¿é¤J¡v¡AµM«áµ²§ôµ{¦¡ªº°õ¦æ¡A§Ú­Ì²{¦b±N¿ù»~°T®§ªºÅã¥Ü§ó§ï¬°¡u¦Û°ÊÂà¦V¨ì¿é¤Jªí³æªººô­¶¡v¡G¡]½d¨Ògoredirect.php°t¦Xredirect.htm¡^
  1. ¡K²¤
  2. if ($name=="" || $email=="" || $memo=="")
  3. {
  4.   header("Location: redirect.htm");
  5. }
  6. else¡K²¤
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

  1. <?
  2. //¸ü¤Jºô­¶«á¡A¦Û°ÊÂà±µÁåµ²¦Ü»P¥Dºô­¶¦P¤@¥Ø¿ý¤¤ªºmessage.htmºô­¶
  3. header("Location: message.htm");
  4. //¸ü¤J¥Dºô­¶«á¡A¦Û°ÊÂà±µÁåµ²¦Ü¥Dºô­¶¤W¤@¼h¥Ø¿ý¤¤ªºex04_01.phpºô­¶
  5. header("Location: ../ch4/ex04_01.php");
  6. //¸ü¤J¥Dºô­¶«á¡A¦Û°ÊÂà±µÁåµ²¦Ü»P¥t¤@ºô§}¤¤ªººô­¶
  7. header("Location: http://www.twbts.com");
  8. ?>
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¤£¤@©w²y²y¬O¦n²y¡A¦ý¬O¦³¾ú½mªº±j¥´ªÌ¡AÀH®É³£¥i¥H´§´Î¡C
ªð¦^¦Cªí ¤W¤@¥DÃD