⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commentadd.asp

📁 单班同学录 一个非常漂亮的同学录 哦
💻 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">&nbsp;</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">&nbsp;</td>
                <td width="418" valign="top"><table width="400" border="0" align="center" cellpadding="2" class="font1">
                    <tr> 
                      <td>您的位置&gt;图片评论 </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>&nbsp;</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">&nbsp; </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">&nbsp;</td>
  </tr>
</table>                    
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -