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

📄 cp_xj.asp

📁 站完全依据SEO技术建立
💻 ASP
字号:
<!--#include file="inc/conn.asp"-->
<!--#include file="sendmail.asp"-->
<%
if request("action")="save" then
user=request("user")
lx=request("lx")
book=request("book")
book_id=request("book_id")
adcp=request("adcp")

cityping=split(cityping,"|")
for i=0 to UBound(cityping)
if instr(user,cityping(i)) or instr(lx,cityping(i)) or instr(book,cityping(i)) then
response.write"<script>alert('咨询出错,下面是产生错误的可能原因:\n\n·在您的咨询资料中含有敏感字符');history.go(-1);</script>"
response.end
end if
next
'========================================
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.open "select * from cp where id="&book_id&"",conn,1,1
yp_id=rs("yp_id")
rs.close
rs.open "select * from yp where id="&yp_id&"",conn,1,1
toname=rs("user")
tomail=rs("mail")
rs.close
set rs=nothing
'========================================
Set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from bookcp"
rs.open sql,conn,1,3
rs.addnew
rs("user")=user
rs("lx")=lx
rs("book_id")=book_id
rs("book")=book
rs("adcp")=adcp
rs("yp_id")=yp_id
rs.update
rs.close
set rs=nothing

if citymailkey1=1 then
mailtitle=toname&" 有人对您的产品进行咨询了!"
mailbody=toname&":"&vbcrlf&vbcrlf&"  "&book&vbcrlf&vbcrlf&"咨询人:"&user&vbcrlf&"联系方式:"&lx&vbcrlf&vbcrlf&"详情请登录:"&cityurl&"cp_view.asp?id="&book_id
sendmail
end if

response.write"<script>alert('操作成功,我们会尽快通知该企业和您联系');window.close();</script>"
response.end

else
id=request("id")
if id="" then
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n·请选择相关参数');history.go(-1);</script>"
response.end
end if
end if
%>

<%=citycss%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>产品咨询 - <%=citytitle%></title>
<script language="JavaScript">
<!--
function checkdata() {
if( addform.user.value =="" || addform.user.value.length<2 || addform.user.value.length>16) {
alert("\产品咨询出错,下面是产生错误的可能原因:\n\n·请输入您的姓名")
return false;
}
if( addform.lx.value =="" || addform.lx.value.length<2 || addform.lx.value.length>40) {
alert("\产品咨询出错,下面是产生错误的可能原因:\n\n·请输入您的联系方式")
return false;
}
if( addform.book.value =="" || addform.book.value.length<10) {
alert("\产品咨询出错,下面是产生错误的可能原因:\n\n·请输入您不少于 10 字的咨询内容")
return false;
}
return true;
}
function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++)  {
TempChar= InString.substring (Count, Count+1);
if (RefString.indexOf (TempChar, 0)==-1)
return (false);
}
return (true);
}
// -->
</script>
<script LANGUAGE=JavaScript>
function textLimitCheck(thisArea, maxLength){
if (thisArea.value.length > maxLength){
alert(maxLength + ' 个字限制. \r超出的将自动去除.');
thisArea.value = thisArea.value.substring(0, maxLength);
thisArea.focus();
}
/*回写span的值,当前填写文字的数量*/
messageCount.innerText = thisArea.value.length;
}
</script>
</hand>

<body style="margin:0">
<%set rs=server.createobject("adodb.recordset")
sql="select * from cp where id="&id&" and key=true and key1=true and key2=true"
rs.open sql,conn,1,1
if rs.eof then
response.write "<script>alert('操作出错,下面是产生错误的可能原因:\n\n·此内容不存在或已过期');history.go(-1);</script>"
response.end
else
cpname=rs("cpname")
end if
rs.close
%>
<table width="400" border="0" cellspacing="0" cellpadding="5" align="center">
<tr><td colspan=2 bgcolor=#006699><strong><font color=white>我要对 <font color=yellow><%=cpname%></font> 咨询</font></strong></td></tr>
<form name="addform" method="post" action="cp_xj.asp?action=save" onSubmit="return checkdata()">
<input name="book_id" type="hidden" value="<%=id%>">
<input name="adcp" type="hidden" value=2>
<tr>
<td width="21%" align="center"><strong>您的姓名</strong></td>
<td width="79%"><input name="user" type="text" size="20" maxlength="20" value="<%=session("colxr")%>"></td>
</tr>
<tr>
<td align="center"><strong>联系方式</strong></td>
<td><input name="lx" type="text" size="25" maxlength="40" value="<%=session("cotel")%>"> 请填写联系您的联系方式</td>
</tr>
<tr>
<td align="center"><strong>反馈内容</strong></td>
<td><p style="line-height:180%"><textarea name="book" cols=40 rows=5 onkeyUp="textLimitCheck(this, 250);">我想请问贵公司 [<%=cpname%>] 产品的详细情况,看到后请尽快回复。</textarea><br>限 10-250 个字符  已输入 <font color="#CC0000"><span id="messageCount">39</span></font> 个字</td>
</tr>
<tr>
<td height=40></td>
<td><input type="submit" name="Submit" value=" 提 交 " class="input1"></td>
</tr>
</form>
</table>

⌨️ 快捷键说明

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