|
這是我寫的搜尋引擎 http://kuso-web.net/search/
可是不懂寫那分頁 , 以下是顯示頁 , 請教應該怎改...寫了好多次都失敗了: ======================================== <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5" /> <title>News Media - Search engine</title> <style type="text/css"> <!-- A:link{color:#ffffff; font-size:12pt; text-decoration:none} A:visited{color:#ffffff; font-size:12pt; text-decoration:none} A:hover{color:yellow; font-size:12pt; text-decoration:underline} A:active{color:yellow; font-size:12pt; text-decoration:underline} --> </style> <style type="text/css"> <!-- .style2 { font-size: 24px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; } body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> </head> <body> <center><table width="100%" border="0" cellspacing="0"> <tr> <td align="left" bgcolor="#990000"><a href="index.php"><img src="imgaes/biglogo.gif" alt="ws" width="150" height="100" border="0" /></a></td> </tr> <tr> <td bgcolor="#FF9900"><table width="100%" border="0" cellspacing="4" cellpadding="4"> <tr> <td align="left"> <? echo "<font size=3><b>Search result as follows:</b></font><br><br>"; $keyin=$_GET["keyin"]; include("db.php"); $row="Select * from search where name like '%$keyin%' or url like '%$keyin%' or content like '%$keyin%' order by sn desc"; $result=mysql_query($row); $total=mysql_num_rows($result); if ($total>=1) { while (list($sn,$name,$url,$mail,$content,$putdate) =mysql_fetch_row($result)) { echo "<table width=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"4\" bgcolor=\"#000000\">"; echo "<tr><td>"; echo "<a href=\"$url\" target=\"_blank\">".htmlspecialchars($name)." - ".htmlspecialchars($url)."</a><br><br>"; echo "<font color=orange>".nl2br(htmlspecialchars($content))."</font>"; echo "</td></tr></table><br><br>"; } echo "Altogether finds ".$total." website"; } else echo "<font color=red>Did not find the content, please inspect whether inputs the mistake!</font>"; ?> </td> </tr> <tr> </tr> </table> <label></label> </form> </td> </tr> <tr> <td bgcolor="#990000"><? include("footer.php"); ?></td> </tr> </table></center></center> </body> </html> ======================================= 1. 怎樣設定當別人點擊網站 , 此網站人氣加 1 2. 怎樣在 index.php 不輸入就按搜尋會彈出警告視窗叫他輸入呢 ? |