The Forum of imitating Oso (IV.) _php Foundation
Last Update:2017-01-19
Source: Internet
Author: User
reply.php (used to reply to theme)
<HTML><HEAD><TITLE> Difficult issues </TITLE>
<link href= "Mypic/style.css" Rel=stylesheet type=text/css><?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 ("Subject cannot be empty!) Nyou must supply a subject. ");
return false;
}
if (Document.form.content.value.length = = 0) {
submitcount--;
Alert ("Add content cannot be empty!") 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 Theme <BR><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><BR></TD></TR>
<TR>
<TD class=mid valign=top> Facial Icons </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= "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= "published" >
<input name=reset type=reset value= "clear" > </TD></TR>
</FORM>
<TR>
<TD Colspan=2><br><br><font color= #797979 >
<LI> the last 5 posts in this topic (in reverse order by post time) </FONT></LI></TD></TR></TBODY></TABLE>
<table align=center bgcolor= #000000 border=0 cellpadding=4 cellspacing=1
Width=100%>
<TBODY>
<tr bgcolor= #666666 >
<TD width= "10%" ><font color= #ffffff > Author </FONT></TD>
<TD width= "90%" ><font color= #ffffff > Content </FONT></TD></TR>
<?php
$query = "SELECT * from Guestbook where main_id=". $theme _id. "or id=". $theme _id. "ORDER by Time_open DESC 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>
"This article copyright belongs to the author and the Osso net jointly owns, if needs to reprint, please indicate the author and the origin"