模仿OSO的论坛(四)

reply.php(用来回复主题) HTMLHEADTITLE疑难问题/TITLE LINK
href=mypic/style.css rel=STYLESHEET type=text/css/HEAD ?php if
(!$cook_user) {echo script language=’javascript’;echo
parent.location.href=’index.php’;echo /script;} else {include
(connect.inc.php); $query = select * from my_user where
user=’.$cook_user.’ and password=’.$cook_password.’;$res =
mysql_query($query);if (!$res) {echo script language=’javascript’;echo
parent.location.href=’index.php’;echo /script;} include connect.inc.php;
if ($content) {$content= str_replace (
‘,mysinglequotes,$content);$content=htmlspecialchars($content);
$content=nl2br($content); $query = INSERT INTO guestbook
(name,type,content,icon,time_open,time_close,answer_count,answer_name,main_id)
VALUES
(‘.$cook_user.’,0,’.$content.’,.$icon.,now(),now(),1,’.$cook_user.’,.$theme_id.);$res
= mysql_query($query); if ($res){$query = update guestbook set
time_close=now(),answer_count=answer_count+1,answer_name=’.$cook_user.’
where id=.$theme_id;$res = mysql_query($query);if ($res) {echo script
language=’javascript’;echo parent.location.href=’post_end.php’; echo
/script;}}}} ? SCRIPT language=JavaScript !– var submitcount=0;
function check_com(){ if(document.form.theme.value.length ==0){
submitcount–; alert(主题不能为空!nYou must supply a subject.); return
false; } if(document.form.content.value.length == 0){ submitcount–;
alert(加贴内容不能为空!nYou must supply a message.); return false; }
return true; } //– /SCRIPT BODY bgColor=#cccc99 bottomMargin=0
leftMargin=0 topMargin=0 marginwidth=0 marginheight=0 form method=post
action=reply.php name=form onSubmit=return check_com() SCRIPT
language=JavaScriptsrc=mypic/x.js/SCRIPT TR TD vAlign=top TABLE border=0
cellPadding=4 cellSpacing=0 width=100% TBODY TR TD class=mid
width=20%回复主题BRBR/TD TD class=midA
class=titlehref=read.php?theme_id=?php echo $theme_id ? ?php$query =
select theme from guestbook where id=.$theme_id; $res =
mysql_query($query);$row = mysql_fetch_row($res);echo $row[0]; ?
/ABRBR/TD/TR TR TD class=mid vAlign=top表情图标/TD TDINPUT CHECKED
name=icon type=radio value=1 IMGalign=ABSCENTER
height=18src=mypic/icon1.gifwidth=18INPUT name=icon type=radio value=2
IMGalign=ABSCENTER height=18src=mypic/icon2.gifwidth=18INPUT name=icon
type=radio value=3 IMGalign=ABSCENTER
height=18src=mypic/icon3.gifwidth=18INPUT name=icon type=radio value=4
IMGalign=ABSCENTER height=18src=mypic/icon4.gifwidth=18INPUT name=icon
type=radio value=5 IMGalign=ABSCENTER
height=18src=mypic/icon5.gifwidth=18INPUT name=icon type=radio value=6
IMGalign=ABSCENTER height=18src=mypic/icon6.gifwidth=18INPUT name=icon
type=radio value=7 IMGalign=ABSCENTER
height=18src=mypic/icon7.gifwidth=18BRINPUT name=icon type=radio value=8
IMGalign=ABSCENTER height=18src=mypic/icon8.gifwidth=18INPUT name=icon
type=radio value=9 IMGalign=ABSCENTER
height=18src=mypic/icon9.gifwidth=18INPUT name=icon type=radio value=10
IMGalign=ABSCENTER height=18src=mypic/icon10.gifwidth=18INPUT name=icon
type=radio value=11 IMGalign=ABSCENTER
height=18src=mypic/icon11.gifwidth=18INPUT name=icon type=radio value=12
IMGalign=ABSCENTER height=18src=mypic/icon12.gifwidth=18INPUT name=icon
type=radio value=13 IMGalign=ABSCENTER
height=18src=mypic/icon13.gifwidth=18INPUT name=icon type=radio value=14
IMGalign=ABSCENTER height=18src=mypic/icon14.gifwidth=18/TD/TR TR TD
class=mid vAlign=topinput type=hidden name=theme_id size=12
class=stedit value=?php echo $theme_id ? 加贴内容/TD TDTEXTAREA cols=50
name=content rows=6/TEXTAREA /TD/TR TR TD/TD TDINPUT name=submit
onclick=return checkSubmit() type=submit value= 发 表 INPUT name=reset
type=reset value= 清 除 /TD/TR /FORM TR TD colSpan=2BRBRFONT
color=#797979 LI本主题最后 5 个帖子 /FONT/LI/TD/TR/TBODY/TABLE TABLE
bgColor=#000000 border=0 cellPadding=4 cellSpacing=1width=100% TBODY TR
bgColor=#666666 TD width=10%FONT color=#ffffff作 者/FONT/TD TD
width=90%FONT color=#ffffff内 容/FONT/TD/TR ?php $query = select *
from guestbook where main_澳门新葡亰3522平台游戏,id=.$theme_id. or id=.$theme_id. order by
time_open DESC limit 5 ; $res = mysql_query($query);function
TdBackColor() { static $ColorStr; if ($ColorStr==#ededed) {
$ColorStr=#dedede; } else { $ColorStr=#ededed; } return($ColorStr); }
for ($i=1;$i=5;$i++) {$row = @mysql_fetch_array($res);if (!$row)
break;$ColorStr=TdBackColor(); echo TR bgColor=.$ColorStr.; echo TD
vAlign=top.$row[‘name’]./td;$content= str_replace (
mysinglequotes,’,$row[‘content’]);echo td.$content./td/tr;}
?/TBODY/TABLE /TBODY/TABLE /FORM /html