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

6-2-4 ÂsÄýªÌªº»y¨¥ª©¥»

6-2-4 ÂsÄýªÌªº»y¨¥ª©¥»

6-2-4   ÂsÄýªÌªº»y¨¥ª©¥»
¡uºô¸ôµL°ê¬É¡A¥@¬É¬O¤@®a¡v¡A±z¥H¬°ºô¸ô¤Wªº¸ê°T¦³°ê§O©Î¦a°ìªº°Ï¤À¶Ü¡H·íµM¨S¦³¡I¥@¬É¦U°ê¨Ï¥Î¦UºØ»y¨¥ªººô¤Í³£¦³¥i¯à¥úÁ{±zªººô¯¸¡A¥Hµ§ªÌªººô¯¸¨Ó»¡¡A¦³¨Ó¦Û¥xÆW¡B­»´ä¡B¤¤°ê¤j³°¡B¬Æ¦Ü¥[®³¤jªººô¤Í¨Ó°ÑÆ[¡A¦]¦¹¡A¬°ªA°È¥@¬É¦U°ê¨Ï¥Î¦UºØ»y¨¥ªººô¤Í¡A±z¥i¯à±Nºô¯¸³W¹º¦¨¦³¦h°ê»y¨¥ªºª©¥»¡A·íºô¤Í¨Ó°ÑÆ[®É¡A¥i¦Û¥Ñ¿ï¾Ü¥L¾A¦Xªº»y¨¥ª©¥»¨ÓÂsÄý¡C

¹Ï6-14  »y¨¥¿ï¾Ü¡C

·í¥@¬É¦U°ê¨Ï¥Î¦UºØ»y¨¥ªººô¤Í¨C¦¸¨Ó¨ì±zªººô¯¸¡A¦pªGºô¤Í²Ä¤@¦¸¥úÁ{ºô¯¸½Ð¤H®a¿ï¾Ü¾A·íªº»y¨¥ª©¥»¨ÓÂsÄý¡A³o¬OµL¥i«p«Dªº¡A¦ýºô¤Í­Y¬O¦A«×¥úÁ{¡A±z¤S­n¤H®a¿ï¾Ü¤@¦¸»y¨¥ª©¥»¨ÓÂsÄý¡A³o¤Ó³Â·Ð¤F¡A¦n¹³¤£¬O«Ü¦nªº«Ý«È¤§¹D¡A©Ò¥H¡A§Ú­Ì¥i¥H§Q¥ÎCookie¨Ó°µ°O¿ý£«¡A·íºô¤Í²Ä¤@¦¸¥úÁ{®É¡A½Ð¥L¿ï¾Ü¾A·íªº»y¨¥ª©¥»¨ÓÂsÄý¡A¦p¤W¹Ï¡A¦Ó¥L¦A«×¥úÁ{§Ú­Ìºô¯¸®É¡A¤£»Ý­n¦A¿ï¾Ü¤@¦¸»y¨¥ª©¥»¡A§Ú­Ì·|ª½±µÂà¦Vºô­¶¨ì¾A¦X¥Lªº»y¤åª©¥»¥h¡C

¹Ï6-15  µ{¦¡¬yµ{¡C

¦b¥»½d¨Òµ{¦¡¤¤¡A§Ú­Ì¥u»Ý­n¤@­ÓCookie¡A¥¦ªº¦WºÙ¬O¡G¡ulanguagename¡v¡A¥¦¬O¥Î¨Ó°O¿ýÂsÄýªÌªº»y¨¥ª©¥»¡A¨ä­È¦³¤U¦C¤TºØ¥i¯à¡G

  • big5¡G´¿¸g¨Ó°ÑÆ[¹Lºô¯¸¡A¦Ó¥B¡A©Ò¿ï¾Üªº»y¨¥ª©¥»¬°¤¤¤åÁcÅé¡C
  • gb¡G´¿¸g¨Ó°ÑÆ[¹Lºô¯¸¡A¦Ó¥B¡A©Ò¿ï¾Üªº»y¨¥ª©¥»¬°¤¤¤å²Åé¡C
  • ¨S¦³CookieÅܼơG¥H«e¨S¨Ó¹L¡A¬O²Ä¤@¦¸¨Ó³X¡A¥²¶·¿ï¾Ü»y¨¥ª©¥»¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

¨­¥÷§PÂ_
·í³X«È¶i¤J±zªº­º­¶¡A§Ú­Ì²Ä¤@¥ó­n°µªº¨Æ¬O¥ý¥h½T»{Cookies¡ulanguagename¡vªº­È¡A¦pªGCookie¡ulanguagename¡v¦s¦b¡A«h¥Nªí³X«È´¿¸g¨Ó¹L¡A±µµÛ¤~¶}©l§PÂ_Cookie¡ulanguagename¡vªº­È¡A¦pªG¨ä­È¬°¡ubig5¡v¡A¥Nªí³X«È­nÂsÄýªº¬O¡y¤¤¤åÁcÅé¡zª©¥»ªººô­¶¡A§Ú­Ì´Nª½±µ±NÂsÄý¦ì¸mÂà¦V¨ì¡y¤¤¤åÁcÅé¡zª©¥»ªººô­¶¥h¡F¦Ó¨ä­È­Y¬O¡ugb¡v¡A¥Nªí³X«È­nÂsÄýªº¬O¡y¤¤¤å²Åé¡zª©¥»ªººô­¶¡A´N±NÂsÄý¦ì¸mÂà¦V¨ì¡y¤¤¤å²Åé¡zª©¥»ªººô­¶¥h¡C
  1. <?
  2. ob_start();
  3. //¨ú±o»y¨¥ª©¥»ªºCookieÅܼƭÈ
  4. if (isset($_COOKIE["languagename"]))
  5. //¨M©w¸Ó¨ì¦ó³B¥h
  6. {
  7.   $languagename=$_COOKIE["languagename"];
  8.   if ($languagename=="big5")
  9.    {
  10.     header("Location: big5.php");
  11.    }
  12.   else
  13.    {
  14.     header("Location: gb.php");
  15.    }
  16. }
  17. ?>
½Æ»s¥N½X
¦bµ{¦¡½X²Ä8»P²Ä15¦æ¤¤¡A§Ú­Ì§Q¥ÎIf§PÂ_±Ô­z¥hÀ°§Ú­Ì§PÂ_»y¨¥ª©¥»Cookies¡ulanguagename¡vªº­È¡A¦pªG¡ulanguagename¡vªº­È¬O¡ubig5¡v¡A´Nª½±µ±NÂsÄý¦ì¸mÂà¦V¨ì¡y¤¤¤åÁcÅé¡zª©¥»ªººô­¶¥h¡F­Y¬O¡ugb¡v¡A´Nª½±µ±NÂsÄý¦ì¸mÂà¦V¨ì¡y¤¤¤å²Åé¡zª©¥»ªººô­¶¥h¡C£«¡I¦pªG¡ulanguagename¡vªº­È¤£¬O¡ubig5¡v©Î¡ugb¡v«ç»ò¿ì¡H¨º´N¤£°µ¥ô¦ó°Ê§@¡Aµ¥«ÝÂsÄýªÌ¿ï¾Ü¾A·íªºª©¥»¡C

¹Ï6-16  ºô­¶Âà¦V¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

³]©w»y¨¥ª©¥»ªºCookie
·íºô¤Í²Ä¤@¦¸¥úÁ{®É¡A§Ú­Ì·|½Ð¥L¶i¦æ»y¨¥ª©¥»ªº³]©w¡A¦bºô­¶¤¤§Ú­Ì©ñ¸m¤F¨â­Ó»y¨¥ª©¥»ªº¿ï¾Ü¹Ï¤ù¡A¨Ã¥B¬°¹Ï¤ù¥[¤W¤F¶WÃìµ²¨Ì¤£¦P¿ï¾Ü³sµ²¨ì¤£¦P»y¨¥ª©¥»ªººô­¶¡C
¦b¤£¦P»y¨¥ª©¥»ªººô­¶¤¤¡A§Ú­Ì¥[¤W¤F§PÂ_»y¨¥ª©¥»Cookies¡ulanguagename¡v­Èªº³]©w±Ô­z¡A¦pªGCookies¡ulanguagename¡vªº­È¬OªÅ¦r¦ê¡A´N±N»y¨¥ª©¥»¼g¤JCookies¡ulanguagename¡v¤º¡A¨Ã±N¦¹Cookies­È³]©w¬°¨Ï¥Î«áªº¤é´Á°_ºâ¡A90¤Ñ¤º³£¦³®Ä¡A¥H¤¤¤åÁcÅéºô­¶¬°¨Ò¡G
  1. <?
  2. ob_start();
  3. //¨ú±o»y¨¥ª©¥»ªºCookieÅܼƭÈ,­YµL»y¨¥ª©¥»³]©w
  4. //±N»y¨¥ª©¥»³]¬°ÁcÅ餤¤å,»y¨¥ª©¥»³]©w90¤Ñ¤º¦³®Ä
  5. if (!isset($_COOKIE["languagename"]))
  6.   {
  7.    setcookie("languagename","big5",time()+7776000);
  8.   }
  9. ?>
½Æ»s¥N½X
¤W¨Ò¤¤¡A¥u¦³¦bCookieÅܼÆlanguagename¤£¦s¦b¡A¤]´N¬O¦bÂsÄý¾¹¤¤¨S¦³§Ú­Ì©Ò»Ý­nªºCookies¡ulanguagename¡v®É¡A¤~¼g¤JCookies¡I
in.php¡]­º­¶¡B»y¨¥ª©¥»§PÂ_¡^
  1. <?
  2. ob_start();
  3. //¨ú±o»y¨¥ª©¥»ªºCookieÅܼƭÈ
  4. if (isset($_COOKIE["languagename"]))
  5. //¨M©w¸Ó¨ì¦ó³B¥h
  6. {
  7.   $languagename=$_COOKIE["languagename"];
  8.   if ($languagename=="big5")
  9.    {
  10.     header("Location: big5.php");
  11.    }
  12.   else
  13.    {
  14.     header("Location: gb.php");
  15.    }
  16. }
  17. ?>

  18. <html>
  19. <head>
  20. <meta http-equiv="Content-Language" content="zh-tw">
  21. <meta http-equiv="Content-Type" content="text/html; charset=big5">
  22. <title>ºô­¶ª©¥»Àˬd</title>
  23. </head>
  24. <body background="bg.gif">
  25. <p align="center">
  26. <img border="0" src="twbtsb1.gif"></p>
  27. <p align="center">
  28. <img border="0" src="choose.gif"></p>
  29. <p align="center">
  30. <!-- ¤¤¤åÁcÅ骺Ãìµ² -->
  31. <a href="big5.php">
  32. <img border="0" src="big5.gif"></a></p>
  33. <p align="center">
  34. <!-- ¤¤¤å²Å骺Ãìµ² -->
  35. <a href="gb.php">
  36. <img border="0" src="gb.gif"></a></p>
  37. </body>
  38. </html>
½Æ»s¥N½X
big5.php¡]ÁcÅéºô­¶¡BÁcÅ骩¥»³]©w¡^
  1. <?
  2. ob_start();
  3. //¨ú±o»y¨¥ª©¥»ªºCookieÅܼƭÈ,­YµL»y¨¥ª©¥»³]©w
  4. //±N»y¨¥ª©¥»³]¬°ÁcÅ餤¤å,»y¨¥ª©¥»³]©w90¤Ñ¤º¦³®Ä
  5. if (!isset($_COOKIE["languagename"]))
  6.   {
  7.    setcookie("languagename","big5",time()+7776000);
  8.   }
  9. ?>

  10. <html>
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=big5">
  13. <title>¤¤¤åÁcÅéºô­¶</title>
  14. </head>
  15. <body background="bg.gif">
  16. <p>§A¦n!!Åwªï¥úÁ{³Â»¶¾Ç¶é</p>
  17. <p><font color="#0000FF" size="5"><b>BIG5½XÁcÅéºô­¶</b></font></p>
  18. </body>
  19. </html>
½Æ»s¥N½X
gb.php¡]²Åéºô­¶¡B²Å骩¥»³]©w¡^
  1. <?
  2. ob_start();
  3. //¨ú±o»y¨¥ª©¥»ªºCookieÅܼƭÈ,­YµL»y¨¥ª©¥»³]©w
  4. //±N»y¨¥ª©¥»³]¬°Â²Å餤¤å,»y¨¥ª©¥»³]©w90¤Ñ¤º¦³®Ä
  5. if (!isset($_COOKIE["languagename"]))
  6.   {
  7.    setcookie("languagename","gb",time()+7776000);
  8.   }
  9. ?>

  10. <html>
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  13. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  14. <meta name="ProgId" content="FrontPage.Editor.Document">
  15. <title>¤¤¤å²Åéºô­¶</title>
  16. </head>
  17. <body background="mainbg.gif">
  18. <p>±z¦n!!Åwªï¥úÁ{³Â»¶¾Ç¶é</p>
  19. <p><font color="#008000" size="5"><b>GB½X²Åéºô­¶</b></font></p>
  20. </body>
  21. </html>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¦pªG§ï¥Î¸U°ê½XUTF8¡A¬O¤£¬O·|¤ñ¸û²³æ¨Ç¡A­Y¬O¼g¦bmysql_connection¸Ì·|¤£·|§ó¦n¡C
¨Ò¦p¡G
<?php
.....
$conn = mysql_connect($server,$username,$password);
$sql =  "SELECT * FROM  Database";
  mysql_query( 'SET NAMES utf8' , $conn );
$result = mysql_query( $sql,$conn );
....
?>

TOP

        ÀR«ä¦Û¦b : ¡i¬O§_µo´§¤F¨}¯à¡H¡j¤H¶¡¹Ø©R¦]¬°µu¼È¡A¤~§óÅã±o¬Ã¶Q¡CÃø±o¨Ó¤@½ë¤H¶¡¡AÀ³°Ý¬O§_¬°¤H¶¡µo´§¤F¦Û¤vªº¨}¯à¡A¦Ó¤£­n¤@¨ý¨Dªø¹Ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD