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

📄 pinglun.asp

📁 一套很早的多用户电子商务程序
💻 ASP
字号:
<!--#include file="conn.asp"-->
<html>
<head>
<title>--用户评论</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<body background="pic/bg.jpg" leftmargin="3" topmargin="4" marginwidth="00">
<%dim Product_id,action
Product_id=request.QueryString("Product_id")
action=request.QueryString("action")
	if action="save" then
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from shop_pinglun",conn,1,3
		rs.addnew
		rs("Product_id")=Product_id
		rs("shop_name")=request("shop_name")
		rs("Product_name")=request("Product_name")
		rs("pingji")=request("pingji")
		rs("pinglunname")=HTMLEncode2(trim(request("pinglunname")))
		rs("pingluntitle")=HTMLEncode2(trim(request("pingluntitle")))
		rs("pingluncontent")=HTMLEncode2(trim(request("pingluncontent")))
		rs("ip")=Request.servervariables("REMOTE_ADDR")
		rs("pinglundate")=now()
		rs("shenhe")=1
		rs.update
		rs.close
		set rs=nothing
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from Product where Product_id='"&Product_id&"'",conn,1,3
		rs("pingji")=rs("pingji")+1
		rs("pingjizong")=rs("pingjizong")+request("pingji")
		rs("pingji_time")=now()
		rs.update
		rs.close
		set rs=nothing
	response.write "<script language=javascript>alert('您的评论已成功提交!');window.opener.location.reload();window.close();</script>"
	response.End
	end if
%>
<form name="pinglunform" method="post" action="pinglun.asp?action=save&Product_id=<%=Product_id%>" onsubmit="return check()" >
  <br>
  <table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#3399FF" bordercolordark="#FFFFFF">
  <tr> 
    <td width="23%">评论标题:</td>
    <td width="77%"><strong><font color="#0000FF">
<input name="pingluntitle" type="text"  size="26">
      </font></strong></td>
  </tr>
  <tr> 
      <td>姓  名:</td>
    <td>
<input name="pinglunname" type="text" size="12">
<input name="shop_name" type="hidden" value="<%=request("shop_name")%>" >
<input name="Product_name" type="hidden" value="<%=request("Product_name")%>" >
  </td>
  </tr>
  <tr> 
      <td>评  级:</td>
    <td><input type="radio" name="pingji" value="5" checked> 
      <img src="images/pingji/5.gif"><br> <input type="radio" name="pingji" value="4"> 
      <img src="images/pingji/4.gif"><br> <input type="radio" name="pingji" value="3"> 
      <img src="images/pingji/3.gif"><br> <input type="radio" name="pingji" value="2"> 
      <img src="images/pingji/2.gif"><br> <input type="radio" name="pingji" value="1"> 
      <img src="images/pingji/1.gif"> </td>
  </tr>
  <tr> 
    <td>评论正文:</td>
    <td><textarea name="pingluncontent" cols="32" rows="4"></textarea></td>
  </tr>
</table>
  <div align="center"><br>
    <input type="submit" name="Submit" value="Submit" >
</div>
</form>
</body>
</html>
<%function HTMLEncode2(fString)
	'fString = Replace(fString, CHR(13), "")
	'fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
	'fString = Replace(fString, CHR(10), "<BR>")
    fString = replace(fString, ">", "&gt;")
    fString = replace(fString, "<", "&lt;")

    fString = Replace(fString, CHR(32), "<I></I>&nbsp;")
    fString = Replace(fString, CHR(9), "&nbsp;")
    fString = Replace(fString, CHR(34), "&quot;")
    fString = Replace(fString, CHR(39), "&#39;")
    fString = Replace(fString, CHR(13), "")
    fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
    fString = Replace(fString, CHR(10), "<BR> ")
	HTMLEncode2 = fString
end function%>
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function check()
{
  if(checkspace(document.pinglunform.pinglunname.value)) {
	document.pinglunform.pinglunname.focus();
    alert("请填写您的姓名!");
	return false;
  }
  if(checkspace(document.pinglunform.pingluntitle.value)) {
	document.pinglunform.pingluntitle.focus();
    alert("请填写评论标题!");
	return false;
  }
  if(checkspace(document.pinglunform.pingluncontent.value)) {
	document.pinglunform.pingluncontent.focus();
    alert("请填写评论正文!");
	return false;
  }
	  }
//-->
</script>

⌨️ 快捷键说明

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