?? commentadd.asp
字號:
<%@LANGUAGE="VBScript.Encode" CODEPAGE="936"%>
<!--#include file="SESSION.asp" -->
<!--#include file="CONN.asp" -->
<!--#include file="CHAR.asp" -->
<%
PhotoID=request("id")
if PhotoID="" or isNumeric(PhotoID)=False Then
response.Redirect("error.asp")
response.end
end if
'添加記錄
if request.ServerVariables("REQUEST_METHOD")="POST" then
if session("usergroup")=1 then
response.write"<script>alert('對不起,您還沒有經過同學驗證,無權發布消息!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
response.end
end if
CommentText=trim(request.Form("CommentText"))
set rs=server.CreateObject("adodb.recordset")
rs.open "comment",conn,2,3
rs.addnew
rs("CommentUser")=session("username")
rs("PhotoID")=PhotoID
rs("CommentText")=CommentText
rs("CommentTime")=now()
rs.update
rs.close
set rs=nothing
CloseDatabase
response.Redirect("photoview.asp?id="&PhotoID)
end if
strsql="select * from photo where photoid="&PhotoID
set rs1=server.CreateObject("adodb.recordset")
rs1.open strsql,conn,1,1
If rs1.bof or rs1.eof then
response.Redirect("error.asp")
end if
%>
<%
if request.Form("method")="submit" then
phototitle=trim(request.Form("phototitle"))
photocomment=trim(request.Form("photocomment"))
photoid=trim(request.Form("id"))
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from photo where photoid="&photoid
rs1.open sql1,conn,3,3
rs1("phototitle")=phototitle
rs1("photocomment")=photocomment
rs1.update
rs1.close
set rs1=nothing
response.Redirect("photo.asp")
end if
photoid=request.QueryString("id")
'response.Write(photoid)
set rs=server.CreateObject("adodb.recordset")
sql="select * from photo where photoid="&photoid
rs.open sql,conn,1,1
phototitle=trim(rs("phototitle"))
photocomment=trim(rs("photocomment"))
photoid=trim(rs("photoid"))
formPath="upload"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title><%=classname%>同學錄</title>
<link href="css/class.css" type=text/css rel=stylesheet>
<script language="JavaScript">
<!--
function checkform()
{if (document.post.CommentText.value.length==0) {
alert("請發表您的評論!");
document.post.CommentText.focus();
return false;
}
if (document.post.CommentText.value.length>250) {
alert("您發表的評論大于所規定字數!");
document.post.CommentText.focus();
return false;
}
return true
}
//-->
</script>
<script language="JavaScript" src="js/DrawImage1.js"></script>
</head>
<body background="images/1.GIF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><img src="images/top_t.gif" width="776" height="43"></td>
</tr>
<tr>
<td width="138"><img src="images/top_l.gif" width="138" height="39"></td>
<td width="584" align="right" bgcolor="#666B52"> </td>
<td width="54"><img src="images/top_r.gif" width="54" height="39"></td>
</tr>
<tr>
<td colspan="3"><table width="776" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" rowspan="2" valign="top" background="images/left_x.gif"><img src="images/left_img.gif" width="120" height="480"></td>
<td rowspan="2" valign="top" bgcolor="#F2F2EA"> <div align="center">
<!--#include file="top.asp" -->
</div>
<table width="618" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"> <div align="center"><br>
<!--#include file="left.asp" -->
</div></td>
<td width="10"> </td>
<td width="418" valign="top"><table width="400" border="0" align="center" cellpadding="2" class="font1">
<tr>
<td>您的位置>圖片評論 </td>
</tr>
</table>
<div align="center">
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/gnymtbz.gif">
<tr>
<td width="135"><img src="images/fbpl.gif" width="135" height="36"></td>
<td> </td>
<td width="100"><img src="images/gnymtyb.gif" width="100" height="36"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/n_bk.gif">
<tr>
<td valign="top"> <table border="0" cellpadding="2" width="400" cellspacing="2">
<tr>
<td> <div align="center">
<form action="" method="post" name="post" id="post" onSubmit="return checkform()">
<table width="100%" border="0" cellpadding="2">
<tr align="center">
<td width="80"><table width="380" border="0" cellpadding="0" cellspacing="1" bgcolor="#666B52">
<tr>
<td height="11"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#FFFFFF"><img src="<%=formPath%>/<%=ubbcode(rs("photoname"))%>" border="0" onload="javascript:if(this.width>380)this.width=380;" ></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr align="center">
<td><table width="380" border="0" cellpadding="0" cellspacing="0" bgcolor="#666B52">
<tr>
<td height="11"><table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td width="100" align="center" valign="top" bgcolor="E3E3CF">
<strong><br>
評論內容:</strong></td>
<td bgcolor="#f1f1eb"><textarea name="CommentText" cols="40" rows="10" id="CommentText"></textarea></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><div align="center">
<input name="photoid" type="hidden" id="photoid">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</div></td>
</tr>
</table>
</form>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="images/n_foot.gif" width="400" height="10"></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
<td width="38" valign="top" background="images/right_b.gif"><img src="images/right_b.gif" width="38" height="5"></td>
</tr>
<tr>
<td align="right" valign="bottom" background="images/right_b.gif"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3"><img src="images/z_f.gif" width="776" height="26"></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -