Reply. php (used to reply to a topic)
<HTML> <HEAD> <TITLE> problem </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 ("the topic cannot be blank! NYou must supply a subject .");
Return false;
}
If (document. form. content. value. length = 0 ){
Submitcount --;
Alert ("add content cannot be blank! 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 = JavaScript
Src = "mypic/x. js"> </SCRIPT>
<TR>
<TD vAlign = top>
<TABLE align = center border = 0 cellPadding = 4 cellSpacing = 0 width = 100%>
<TBODY>
<TR>
<TD class = mid width = 20%> reply topic <BR> </TD>
<TD class = mid> <A class = title
Href = "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];
?>
</A> <BR> </TD> </TR>
<TR>
<TD class = mid vAlign = top> emoticons </TD>
<TD> <input checked name = icon type = radio value = 1> Align = ABSCENTER height = 18
Src = "mypic/icon1.gif"
Width = 18> <INPUT name = icon type = radio value = 2> Align = ABSCENTER height = 18
Src = "mypic/icon2.gif"
Width = 18> <INPUT name = icon type = radio value = 3> Align = ABSCENTER height = 18
Src = "mypic/icon3.gif"
Width = 18> <INPUT name = icon type = radio value = 4> Align = ABSCENTER height = 18
Src = "mypic/icon4.gif"
Width = 18> <INPUT name = icon type = radio value = 5> Align = ABSCENTER height = 18
Src = "mypic/icon5.gif"
Width = 18> <INPUT name = icon type = radio value = 6> Align = ABSCENTER height = 18
Src = "mypic/icon6.gif"
Width = 18> <INPUT name = icon type = radio value = 7> Align = ABSCENTER height = 18
Src = "mypic/icon7.gif"
Width = 18> <BR> <INPUT name = icon type = radio value = 8> Align = ABSCENTER height = 18
Src = "mypic/icon8.gif"
Width = 18> <INPUT name = icon type = radio value = 9> Align = ABSCENTER height = 18
Src = "mypic/icon9.gif"
Width = 18> <INPUT name = icon type = radio value = 10> Align = ABSCENTER height = 18
Src = "mypic/icon10.gif"
Width = 18> <INPUT name = icon type = radio value = 11> Align = ABSCENTER height = 18
Src = "mypic/icon11.gif"
Width = 18> <INPUT name = icon type = radio value = 12> Align = ABSCENTER height = 18
Src = "mypic/icon12.gif"
Width = 18> <INPUT name = icon type = radio value = 13> Align = ABSCENTER height = 18
Src = "mypic/icon13.gif"
Width = 18> <INPUT name = icon type = radio value = 14> Align = ABSCENTER height = 18
Src = "mypic/icon14.gif"
Width = 18> </TD> </TR>
<TR>
<TD class = mid vAlign = top> <input type = "hidden" name = "theme_id" size = "12" class = "stedit" value = "<? Php echo $ theme_id?> ">
Add content </TD>
<TD> <TEXTAREA cols = 50 name = content rows = 6> </TEXTAREA> </TD> </TR>
<TR>
<TD> </TD>
<TD> <INPUT name = submit onclick = "return checkSubmit ()" type = submit value = "">
<INPUT name = reset type = reset value = "clear"> </TD> </TR>
</FORM>
<TR>
<TD colSpan = 2> <BR> <FONT color = #797979>
<LI> last five posts in this topic (sorted by post time in reverse order) </FONT> </LI> </TD> </TR> </TBODY> </TABLE>
<TABLE align = center bgColor = #000000 border = 0 cellPadding = 4 cellSpacing = 1
Width = 100% type = "codeph" text = "/codeph">
<TBODY>
<TR bgColor = #666666>
<TD width = "10%"> <FONT color = # ffffff> operator </FONT> </TD>
<TD width = "90%"> <FONT color = # ffffff> internal capacity </FONT> </TD> </TR>
<? Php
$ Query = "select * from guestbook where main_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>
[This article is copyrighted by the author and osuo. If you need to reprint it, please indicate the author and its source]