一千个奥特曼大战一千个怪兽电影 一个分页的论坛
程序员文章站
2022-05-31 08:47:45
...
-------------------------------论坛-------------------------- <br>数据表 <br>create table guest(id int not null auto_increment,primary key(id),title varchar(50),email varchar(30),homepage varchar(30),name varchar(30),text text,relay int,r_time date) <br>create table relay(id int not null auto_increment,primary key(id),title int,email varchar(30),name varchar(30),text text) <br>-------------------------index.php-------------------------- <br><STYLE>TD{FONT-FAMILY:"宋体";FONT-SIZE:13pt}BODY{FONT-FAMILY:"宋体";FONT-SIZE:13pt}SELECT{FONT-FAMILY:"宋体";FONT-SIZE:13pt}A{COLOR:blue;FONT-FAMILY:"宋体";FONT-SIZE:13pt;TEXT-DECORATION:none}</STYLE> <br> <div> <p align=center><font size=14><b>网站完全手册</font></p> </div> <br><?php <br>$db =mysql_connect("localhost", "****","****"); <br>mysql_select_db("****",$db); <br>@$result = mysql_query("SELECT * FROM guest order by id desc",$db); <br> $i=0; <br>while($myrow = mysql_fetch_row($result)) { <br> $guestbook[$i][0] = $myrow[0]; <br> $guestbook[$i][1] = $myrow[1]; <br> $guestbook[$i][2] = $myrow[2]; <br> $guestbook[$i][3] = $myrow[4]; <br> $guestbook[$i][4]=$myrow[6]; <br> $guestbook[$i][5]=$myrow[7]; <br> $i++; <br>} //读入数组 <br>mysql_close($db) ; <br> echo "-----------------------------共["; <br>if ($q!="") { <br> $page = $q; <br>} else { <br> $page = 0; <br>} <br>$i=count($guestbook); <br>$msgnum=20; // 每页20笔 <br>$start = $page * $msgnum; <br>$end = $start + $msgnum; <br>if ($end > $i) $end=$i; <br>$totalpage=$i/$msgnum; <br>for ($i=0; $i<$totalpage; $i++) { <br> if ($i!=$page) { <br> echo "<a href=index.php?q=$i> $i</a>"; <br> } else { <br> echo " $i"; <br> } <br>} <br> echo "]页-----------------------------<br>"; printf("<p align=right><a href=111.php>添加主题</a></p>"); <br> echo "<br>"; <br> echo "<table width=700 hight=560 align=center border=1 >"; <br> echo "<tr>";echo "<td align=center width=200 bgcolor=aaaaaa border=1 style=border: 1px solid rgb(3,2,1)>主题</td>"; <br> echo "<td align=center width=200 bgcolor=aaaaaa border=1 style=border: 1px solid rgb(3,2,1)>电子邮件</td>"; <br> echo "<td align=center width=80 bgcolor=aaaaaa border=1 style=border: 1px solid rgb(3,2,1)>呢称</td>"; <br> echo "<td align=center width=60 bgcolor=aaaaaa border=1 style=border: 1px solid rgb(3,2,1)>回复</td>"; <br> echo "<td align=center width=200 bgcolor=aaaaaa border=1 style=border: 1px solid rgb(3,2,1)>最后回复时间</td>"; <br> echo "</tr>"; <br> for ($i=$start; $i<$end; $i++) { <br> $id=$guestbook[$i][0]; <br> echo "<tr >";echo "<td align=center width=200 bgcolor=bbbbbb border=0 style=border: 1px solid rgb(3,2,1)>"; <br> echo "<a href=444.php?id=$id>";echo $guestbook[$i][1]; echo "</a>"; echo "</td>"; <br> echo "<td align=center width=200 bgcolor=bbbbbb border=0 style=border: 1px solid rgb(3,2,1)>"; <br> echo "<a href=mailto:".$guestbook[$i][2].">"; echo $guestbook[$i][2];echo "</a>";echo "</td>"; <br> echo "<td align=center width=80 bgcolor=bbbbbb border=0 style=border: 1px solid rgb(3,2,1)>"; <br> echo $guestbook[$i][3]; echo "</td>"; <br> echo "<td align=center width=60 bgcolor=bbbbbb border=0 style=border: 1px solid rgb(3,2,1)>"; <br> echo $guestbook[$i][4]; echo "</td>"; <br> echo "<td align=center width=200 bgcolor=bbbbbb border=0 style=border: 1px solid rgb(3,2,1)>"; <br> echo $guestbook[$i][5]; echo "</td>"; <br> echo "</tr>"; <br>} <br> echo "</table>"; <br> echo "<br>"; <br> printf("<a href=111.php>添加主题</a>"); <br>?> <br>------------------------------444.php-------------------------------- <br><STYLE>TD{FONT-FAMILY:"宋体";FONT-SIZE:13pt}BODY{FONT-FAMILY:"宋体";FONT-SIZE:13pt}SELECT{FONT-FAMILY:"宋体";FONT-SIZE:13pt}A{COLOR:blue;FONT-FAMILY:"宋体";FONT-SIZE:13pt;TEXT-DECORATION:none}</STYLE> <br> <?php <br>$db =mysql_connect("localhost", "****","****"); <br>mysql_select_db("****",$db); <br>@$result = mysql_query("SELECT * FROM guest where",$db); <br> echo "<table width=700 align=center border=1 >"; <br>$myrow = mysql_fetch_row($result); <br> echo "<tr higth=20>";echo "<td align=center width=700 bgcolor=888888 border=1 style=border: 1px solid rgb(3,2,1)>主题:"; echo $myrow[1]; echo "</td>"; echo "</tr>"; <br> $msg=base64_decode($myrow[5]); <br>$msg = ereg_replace(" "," ",$msg); //空格处理 <br> $msg=nl2br($msg); // 换行处理 <br> if ($myrow[3]!=""){$myrow[3]="<a href=http://$myrow[3]>$myrow[3]</a>";} <br> else <br> {$myrow[3]="我还没在网上安家";} <br> echo "<tr higth=60>"; echo "<td width=700 bgcolor=bbbbbb border=1 style=border: 1px solid rgb(3,2,1)>"; echo $msg;echo "</td>";echo "</tr>"; <br> echo "<tr higth=20>"; echo "<td align=center width=700 bgcolor=bbbbee border=1 style=border: 1px solid rgb(3,2,1)>主页:"; echo $myrow[3]; echo "</td></tr>"; <br> echo "<tr higth=20>";echo "<td align=center width=700 bgcolor=888888 border=1 style=border: 1px solid rgb(3,2,1)>"; echo "回复列表"; echo "</td>"; echo "</tr>"; <br> $num=$myrow[6]; <br> @$result1 = mysql_query("SELECT * FROM relay where title='$id' order by id desc",$db); <br> $i=0; <br>while($myrow1 = mysql_fetch_row($result1)) { <br> $guestbook[$i][0] = $myrow1[1]; <br> $guestbook[$i][1] = $myrow1[2]; <br> $guestbook[$i][2] = $myrow1[3]; <br> $guestbook[$i][3]=$myrow1[4]; <br> $i++; <br>} <br>mysql_close($db); <br>if ($q!="") { <br> $page = $q; <br>} else { <br> $page = 0; <br>} <br>$i=count($guestbook); <br>$msgnum=5; // 每页5笔 <br>$start = $page * $msgnum; <br>$end = $start + $msgnum; <br>if ($end > $i) $end=$i; <br>$totalpage=$i/$msgnum; <br> for ($i=$start; $i<$end; $i++) { <br> $t=$guestbook[$i][0]; <br> echo "<tr >";echo "<td align=center width=700 bgcolor=aaaaaa border=0 style=border: 1px solid rgb(3,2,1)>"; <br>echo "Re:"; echo $myrow[1]; echo "</td>"; echo "</tr>"; <br> echo "<tr >"; echo "<td align=center width=700 bgcolor=bbbbbb border=0 style=border: 1px solid rgb(3,2,1)>"; <br> echo $guestbook[$i][2]; echo "</td>"; echo "</tr>"; <br> echo "<tr >"; echo "<td align=center width=700 bgcolor=bbbbee border=0 style=border: 1px solid rgb(3,2,1)>电子邮件:"; <br> echo "<a href=mailto:".$guestbook[$i][1].">"; echo $guestbook[$i][1];echo "</a>";echo "</td>"; echo "</tr>"; <br> $msg=base64_decode($guestbook[$i][3]); <br> $msg = ereg_replace(" "," ",$msg); <br> $msg=nl2br($msg); <br>echo "<tr >"; echo "<td width=700 bgcolor=bbbbbb border=0 style=border: 1px solid rgb(3,2,1)>"; <br> echo $msg; echo "</td>"; echo "</tr>"; <br> } <br> echo "</table>"; echo "<br>"; echo "<br>"; echo "-------------------------------共["; <br> for ($i=0; $i<$totalpage; $i++) { <br> if ($i!=$page) { <br> echo "<a href=444.php?q=$i&id=$id> $i</a>"; <br> } else { <br> echo $i; <br> } <br>} echo "]页---------------------------------"; echo "<br>"; <br> echo "<a href=333.php?t=$id&num=$num>回复</a>";echo "<br>"; <br> echo "<a href=index.php>浏览主题</a>"; <br>?> <br>--------------------------------333.php----------------------------- <br><html> <br><head> <br> <?php <br> if (!$t){ <br> if ($text==""&$email==""&$name==""){echo "*必填";echo "<a href=333.php?t=$title&name=$name&email=$email&text=$text&num=$num>返回</a>"; } <br> else { if (eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$email)){ <br> $text = base64_encode($text); //检验邮件地址是否合法 <br>$db =mysql_connect("localhost", "****","****"); <br> $time=date("y-m-d"); <br>mysql_select_db("****",$db); <br> $sql="insert into relay values('','$title','$email','$name','$text')"; <br>$result = mysql_query($sql); <br>$num=$num+1; <br>$sql="update guest set relay='$num',r_time='$time' where"; <br>$result=mysql_query($sql); <br> mysql_close(); <br> echo "<META HTTP-EQUIV=REFRESH C URL=444.php?id=$title'>"; <br> } <br>else { echo "邮件地址无效"; echo "<a href=333.php?t=$title&name=$name&text=$text&num=$num>返回</a>";} <br> } } <br>else <br>{ ?> <FORM ACTION="333.php" METHOD="post"> <br> <table border=0 cellpadding=2 width=395> <br> <tr> <br> <td width=20%><input type=hidden name=title value="<? echo $t; ?>"></td></tr> <br> <tr> <br> <td nowrap><font color=004080>呢称:*</font></td> <br> <td width=10%><input type=text name=name size=10 value="<? echo $name; ?>"></td> <br> </tr> <br> <tr> <br> <td nowrap><font color=004080>邮件:*</font></td> <br> <td width=20%><input type=text name=email size=20 value="<? echo $email; ?>"></td> <br> </tr> <br> <tr> <br> <td width=20%><input type=hidden name=num value="<? echo $num; ?>"></td> <br> </tr> <br> <tr> <br> <td nowrapvalign=top><font color=004080>内容:*</font></td> <br> <td width=80% colspan=3><textarea rows=5 name=text cols=50 size=255><? echo $text; ?></textarea></td> <br> </tr> <br> <tr> <br> <td width=100% colspan=4 align=center> <br> <input type=submit value="送出"> <br> <input type=reset value="擦掉"> <br> </td> <br> </tr> </table> <br></FORM> <? } <br> ?> <br> </head> <br><body> <br></html> <br>-----------------------------------www.php-------------------------- <br> <HTML> <br><HEAD> <br><?php <br> if ($title!=""&$email!=""&$name!="") { <br> if (eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$email)){ <br> $text = base64_encode($text); //检验邮件地址是否合法 <br> $db =mysql_connect("localhost", "****","****"); <br> $time=date("y-m-d"); <br>mysql_select_db("****",$db); <br> $sql="insert into guest values('','$title','$email','$homepage','$name','$text','','$time')"; <br>$result = mysql_query($sql);mysql_close(); <br>echo "<META HTTP-EQUIV=REFRESH C URL=index.php'>"; <br> } <br>else <br>{ echo "邮件地址无效"; echo "<a href=111.php?title=$title&&homepage=$homepage&name=$name&text=$text>返回</a>";} } <br>else {echo "*必填"; echo "<a href=111.php?title=$title&email=$email&homepage=$homepage&name=$name&text=$text>返回</a>";} <br> //mysql_close($db) <br>//printf("留言成功<a href=222.php>按此返回</a>"); <br> ?> <br> </HEAD> <br><BODY> <br></BODY> <br></HTML> <br>--------------------------------111.php--------------------------- <br><html> <br><head> <br></head> <br><body> <br><FORM ACTION="www.php" METHOD="post"> <br><table border=0 cellpadding=2 width=395> <br> <tr> <br> <td nowrap><font color=004080>标题:*</font></td> <br> <td width=20%><input type=text name=title size=30 value="<? echo $title; ?>"></td></tr><tr> <br> <td nowrap><font color=004080>邮件:*</font></td> <br> <td width=20%><input type=text name=email size=30 value="<? echo $email; ?>"></td> <br> </tr> <br> <tr> <br> <td nowrap><font color=004080>主页:</font></td> <br> <td width=25%><input type=text name=homepage size=30 value="<? echo $homepage; ?>"></td> <br> </tr> <br> <tr> <br> <td nowrap><font color=004080>呢称:*</font></td> <br> <td width=10%><input type=text name=name size=10 value="<? echo $name; ?>"></td> <br> </tr> <br> <tr> <br> <td nowrapvalign=top><font color=004080>内容:</font></td> <br> <td width=80% colspan=3><textarea rows=5 name=text cols=50 size=255 ><? echo $text; ?></textarea></td> <br> </tr> <br> <tr> <br> <td width=100% colspan=4 align=center> <br> <input type=submit value="送出"> <br> <input type=reset value="擦掉"> <br> </td> <br> </tr> </table> <br></FORM> <br></body> <br></html> <br>【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】 <br>
<p>
以上就介绍了一千个奥特曼大战一千个怪兽电影 一个分页的论坛,包括了一千个奥特曼大战一千个怪兽电影方面的内容,希望对PHP教程有兴趣的朋友有所帮助。</p>
<p>
</p>
上一篇: 传智健康项目讲义第三章 三
下一篇: python标准库sqlite3使用