11-2-3 ¥DÃD¶µ¥Ø¦Cªí»P·s¥DÃD¸ê®Æ³B²zµ{¦¡
¡@¼ÊºÙ: ¤p»x ¡@ÀY»Î: ´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
- ©«¤l
- 1190
- ¥DÃD
- 394
- ºëµØ
- 113
- ¿n¤À
- 1747
- ÂI¦W
- 1
- §@·~¨t²Î
- Vista
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 200
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2024-11-23
|
11-2-3 ¥DÃD¶µ¥Ø¦Cªí»P·s¥DÃD¸ê®Æ³B²zµ{¦¡
11-2-3 ¥DÃD¶µ¥Ø¦Cªí»P·s¥DÃD¸ê®Æ³B²zµ{¦¡
°Q½×¶µ¥Ø¦Cªíµ{¦¡ºô¶index.php¬O¶i¤J¡u°Q½×°Ï¡vªº¤jªùºô¶¡A³oÓºô¶¥]§t¨â¤j³¡¤À¡A¤@¬O¥þ³¡°Q½×¶µ¥Øªº¦Cªí³¡¤À¡A¶i¤J¦¹¤@µ{¦¡ºô¶«á¡A¦pªGÂI¿ï¤F¬Y¤@Ó¤w¦s¦bªº°Q½×¶µ¥Ø¡y¥DÃD¡z¶W³sµ²¡A´N¥i¥H³sµ²¶i¤J¸Ó°Q½×¥DÃDªº¹ïÀ³°Q½×ºô¶¡]join.php¡^¡A¦pªG·Qnµoªí·sªº°Q½×¶µ¥Ø¡A´N¥iª½±µ¦bµ{¦¡ºô¶¤U¤èªºµo¨¥ªí³æ¤¤¿é¤J¸ê®Æ¨Ó«Ø¥ß·sªº°Q½×¥DÃD¡G
¹Ï11-33 index.php¡C
¦]¦¹¡A§Ú̵{¦¡ªº³]p´N¤À¬°¨âÓ³¡¤À¡A¦b¥þ³¡°Q½×¶µ¥Øªº¦Cªí³¡¤À¡A§ÚÌ¥un¶}±Ò¸ê®Æ®w¡AµM«á±N¡y¥D¼ÐÃD¡z¸ê®Æªí¤¤ªº¬ÛÃöÄæ¦ì¸ê®Æ¨ú¥X¨Ó¡A¨Ã¥B¥[¤W¬ÛÃöªºHTMLªí®æ¼ÐÅÒ²Õ¦X´N¥i§¹¦¨¥ô°È¡G- <?
- //±N¸ê®Æ¿ýÂà´«¬°Äæ¦ì°}¦C¶°¦X
- While (($fielddatas=mysql_fetch_array($datalist)))
- {
- ?>
- <TR Valign=TOP>
- <TD NoWrap width="20%" bgcolor="#E8FFFF">
- <p align="center"><font size="2">
- <?=$fielddatas["µo¨¥¤é´Á"];?></font></TD>
- <TD width="20%" bgcolor="#E8FFFF">
- <p align="center"><font size="2">
- <?=$fielddatas["©m¦W"];?></font></TD>
- <TD width="50%" bgcolor="#E8FFFF">
- <A HREF=join.php?ID=<?=$fielddatas["¥D½s¸¹"];?>>
- <font size="2">
- <?=$fielddatas["¥DÃD"];?></font></A></TD>
- <TD width="10%" bgcolor="#E8FFFF">
- <p align="center"><font size="2">
- <?=$fielddatas["½g¼Æ"];?></font></TD>
- </TR>
- <?
- }
- ?>
½Æ»s¥N½X §Q¥ÎWhile°j°é±Ôz±N©Ò¦³¸ê®Æªí¤¤¸ê®Æ¿ýÄæ¦ìªº¸ê®Æ¥þ³¡¨ú¥X¦Cªí¡A°j°é±Ôz°±¤î°õ¦æªº±ø¥ó¬° mysql_fetch_array()¨ç¼Æ¶Ç¦^FalseȮɡA·N«ä´N¬O»¡°Ê§@¤¤¸ê®Æ¿ýªº¦ì¸mY¶W¹L¸ê®Æ¿ý³Ì«á¤@µ§¸ê®Æ®É´N°±¤î°j°é±Ôz¡A·íµM¡A¦b°j°é¤¤±Ôz°õ¦æŪ¨ú¤@µ§¸ê®Æ¿ý¸ê®Æ«á¡Amysql_fetch_array()¨ç¼Æ·|¦Û°Ê±N§@¥Î¤¤¸ê®Æ¿ýªº¦ì¸m²¾¦Ü¤U¤@µ§¸ê®Æ¤W¡I
µ{¦¡½X²Ä14¦æ»P²Ä16¦æ¡G¬°¤FÂI¿ï¬Y¤@Ó¤w¦s¦bªº°Q½×¶µ¥Ø¡u¥DÃD¡v¶W³sµ²«á¡A¥i¥H³sµ²¶i¤J¸Ó°Q½×¥DÃDªº¹ïÀ³°Q½×ºô¶¡]join.php¡^¡A©Ò¥H§ÚÌ¥²¶·§Q¥Î¥D¼ÐÃD¸ê®Æªí¤¤¡y¥D½s¸¹¡zªºÄæ¦ì¸ê®Æ¨Ó«Ø¥ß¶W³sµ²¡A·íµ{¦¡ºô¶°õ¦æ«á¡A§ÚÌÀ˵øºô¶ªºì©l½X±NÀò±o¤U¦Cµ²ªG¡G- <TD width="50%" bgcolor="#E8FFFF"><A HREF=join.php?ID=1>
- <font size="2">
- ´ú¸Õ</font></A></TD>
½Æ»s¥N½X ¬°¤FÅý¸û±ßµoªíªº°Q½×¥DÃD¦b¦Cªí®É¯à±Æ¦bºô¶ªº¤W¤è¡A¦]¦¹¡A§Ú̦b¶}±Ò¸ê®ÆªíªºSQL±Ôz¤¤¡A°£¤F«ü©w¶}±Òªº¸ê®Æªí¬°MainTitle¡]¥D¼ÐÃD¡^¥~¡AÁÙ¥[¤W¤F¡uOrder By µo¨¥¤é´Á Desc¡vªº±Æ§Ç»yªk±Ôz¡A¤]´N¬O¨Ì·Ó¡yµo¨¥¤é´Á¡zÄæ¦ìªº¸ê®Æ¤º®e°µ»¼´î±Æ§Ç¡C- //«Ø¥ß¬d¸ß¦r¦ê
- $SQL="Select * From MainTitle Order By µo¨¥¤é´Á Desc";
- //±N¦^¶Çµ²ªG¦s©ñ©óÅܼƤ¤
- $datalist=mysql_query($SQL);
½Æ»s¥N½X |
|
¤ß¦w¡A¥¦w
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!
|
|
|
|
|
¡@¼ÊºÙ: ¤p»x ¡@ÀY»Î: ´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
- ©«¤l
- 1190
- ¥DÃD
- 394
- ºëµØ
- 113
- ¿n¤À
- 1747
- ÂI¦W
- 1
- §@·~¨t²Î
- Vista
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 200
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2024-11-23
|
index.php- <?
- //³sµ²MySQL Server
- $conn = mysql_connect("localhost", "root", "12345a");
- //¿ï¾Ü¸ê®Æ®w
- mysql_select_db("BBS", $conn);
- //«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
- mysql_query("set character set big5");
- //«Ø¥ß¬d¸ß¦r¦ê
- $SQL="Select * From MainTitle Order By µo¨¥¤é´Á Desc";
- //±N¦^¶Çµ²ªG¦s©ñ©óÅܼƤ¤
- $datalist=mysql_query($SQL);
- ?>
- <HTML>
- <head><title>PHP¾Ç²ß°Q½×°Ï</title>
- <meta http-equiv="Content-Type" content="text/html; charset=big5">
- </head>
- <BODY>
- <h2 Align="Center"><img border="0" src="bbs.gif"></h2>
- <TABLE Border=0 Cellspacing=5 width="100%">
- <TR BgColor=#00FFFF>
- <TD align="center" bgcolor="#0066FF" width="20%">
- <font size="2" color="#FFFFFF">¤é´Á/®É¶¡</font></TD>
- <TD NoWrapP align="center" bgcolor="#0066FF" width="20%">
- <font size="2" color="#FFFFFF">°Q½×µo°_¤H</font></TD>
- <TD align="center" bgcolor="#0066FF" width="50%">
- <font size="2" color="#FFFFFF">¥DÃD</font></TD>
- <TD align="center" bgcolor="#0066FF" width="10%">
- <font size="2" color="#FFFFFF">¦^À³½g¼Æ</font></TD></TR>
-
- <?
- //±N¸ê®Æ¿ýÂà´«¬°Äæ¦ì°}¦C¶°¦X
- While (($fielddatas=mysql_fetch_array($datalist)))
- {
- ?>
- <TR Valign=TOP>
- <TD NoWrap width="20%" bgcolor="#E8FFFF">
- <p align="center"><font size="2">
- <?=$fielddatas["µo¨¥¤é´Á"];?></font></TD>
- <TD width="20%" bgcolor="#E8FFFF">
- <p align="center"><font size="2">
- <?=$fielddatas["©m¦W"];?></font></TD>
- <TD width="50%" bgcolor="#E8FFFF">
- <A HREF=join.php?ID=<?=$fielddatas["¥D½s¸¹"];?>>
- <font size="2">
- <?=$fielddatas["¥DÃD"];?></font></A></TD>
- <TD width="10%" bgcolor="#E8FFFF">
- <p align="center"><font size="2">
- <?=$fielddatas["½g¼Æ"];?></font></TD>
- </TR>
- <?
- }
- ?>
- </TABLE>
-
- <TABLE Width="100%"><TR><TD Align=Center bgcolor=#000080>
- <B><font color="#FFFFFF" size="2">§Ú¦³·s°ÝÃDn°Q½×</font></B>
- </TD></TR></TABLE>
- <CENTER>
- <FORM Action=addnew.php Method=POST>
- <TABLE Border="1" bgcolor="#FFCC66" bordercolor="#FF9933" cellspacing="0">
- <TR><TD><font size="2">©m¦W¡G</font></TD>
- <TD><font size="2"><INPUT Type="text" Size="30" Name="©m¦W"></font></TD></TR>
- <TR><TD><font size="2">Email¡G</font></TD>
- <TD><font size="2"><INPUT Type="text" Size="30" Name="Email">
- </font>
- </TD></TR>
- <TR><TD><font size="2">¥DÃD¡G</font></TD>
- <TD><font size="2"><INPUT Type="text" Size="60" Name="¥DÃD">
- </font>
- </TD></TR>
- <TR><TD><font size="2">¤º®e¡G</font></TD>
- <TD><font size="2"><TEXTAREA Name="¤º®e" Rows="8" Cols="60">
- </TEXTAREA></font></TD></TR>
- </TABLE>
- <INPUT Type="submit" Value="°e¥X°Q½×¥DÃD">
- </FORM>
- </CENTER>
- </BODY>
- </HTML>
½Æ»s¥N½X |
|
¤ß¦w¡A¥¦w
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!
|
|
|
|
|
¡@¼ÊºÙ: ¤p»x ¡@ÀY»Î: ´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
- ©«¤l
- 1190
- ¥DÃD
- 394
- ºëµØ
- 113
- ¿n¤À
- 1747
- ÂI¦W
- 1
- §@·~¨t²Î
- Vista
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 200
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2024-11-23
|
·s¥DÃD¸ê®Æ³B²zµ{¦¡
¤§«e½Í¨ì¡G¦pªG·Qnµoªí·sªº°Q½×¶µ¥Ø¡A¥iª½±µ¦bµ{¦¡ºô¶¡]index.php¡^¤U¤èªºµo¨¥ªí³æ¤¤¿é¤J¸ê®Æ¨Ó«Ø¥ß·sªº°Q½×¥DÃD¡A¦ý¬O¡Aindex.phpºô¶µ{¦¡¨Ã¤£t³d³B²z·s°Q½×¥DÃD«Ø¥ß»P¼g¤J¸ê®Æ®w¤¤ªº¥ô°È¡A¦Ó¬O±N¬ÛÃöªº¸ê®Æ©ó¶ñ¼g§¹«ö¤U¡y°e¥X°Q½×¥DÃD¡z«ö¶s«á¥æ¥Ñaddnew.phpµ{¦¡¨Ó³B²z¡C
- ¥»·s¥DÃD³B²zµ{¦¡addnew.php·s¼W¸ê®Æ¿ý¬O¨Ï¥ÎSQL»y¨¥ªºInsert Into©R¥O±Ôz¡C
- §¹¦¨·s¼W¸ê®Æ¿ý¼g¤J¸ê®Æ®w«á¡A°O±o±Nºô¶³sµ²Âà¦V¦^index.phpµ{¦¡ºô¶¡A§_«hÂsÄýªÌ©Ò¨£¨ìªº±N¥u¬O¤@Ӫťպô¶¡C
addnew.php- <?
- //³sµ²MySQL Server
- $conn = mysql_connect("localhost", "root", "12345a");
- //¿ï¾Ü¸ê®Æ®w
- mysql_select_db("BBS", $conn);
- //«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
- mysql_query("set character set big5");
- //±N³æ¤Þ¸¹¸m´«¬°Âù¤Þ¸¹
- Function chgStr($data)
- {
- $chgStr = "'" . str_replace("'", "''", $data) . "'";
- return $chgStr;
- }
- //±N¸ê®Æ¼g¤J¸ê®Æ®w
- $sql = "Insert Into maintitle (©m¦W, Email, ¥DÃD, ¤º®e, ½g¼Æ, µo¨¥¤é´Á) Values (";
- $sql = $sql . chgStr($_REQUEST["©m¦W"]) . ",";
- $sql = $sql . chgStr($_REQUEST["Email"]) . ",";
- $sql = $sql . chgStr($_REQUEST["¥DÃD"]) . ",";
- $sql = $sql . chgStr(nl2br($_REQUEST["¤º®e"])) . ",";
- $sql = $sql . 0 . ",'";
- $sql = $sql . date("Y-m-j H:i:s") . "')";
- mysql_query($sql);
- header("Location: index.php");
- ?>
½Æ»s¥N½X |
|
¤ß¦w¡A¥¦w
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!
|
|
|
|
|