?? contact.asp
字號:
<%@ Language=VBScript%>
<%
Response.Buffer=true
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<%
set cn = Server.CreateObject("ADODB.Connection")
cn.Open(mycnstr)
set rs = Server.CreateObject("ADODB.Recordset")
set rs2 = Server.CreateObject("ADODB.Recordset")
sqltext="select * from syswork where code='101'"
rs.Open sqltext,cn,1,1
if not rs.EOF then
co_address=trim(rs("address2"))
co_phone=trim(rs("phone"))
co_email=trim(rs("email"))
co_fax=trim(rs("fax"))
co_linkman=trim(rs("linkman2"))
co_zip=trim(rs("zip"))
end if
rs.close
mymenu="contact"
flag=Request.QueryString("flag")
if Request.ServerVariables("REQUEST_METHOD")="POST" then
topic=Request.Form("topic")
email=Request.Form("email")
myname=Request.Form("myname")
corpname=Request.Form("corpname")
address=Request.Form("address")
phone=Request.Form("phone")
fax=Request.Form("fax")
content=Request.Form("content")
mailstr="姓名:" + myname + chr(10) + chr(13)
mailstr=mailstr + "單位:" + corpname + chr(10) + chr(13)
mailstr=mailstr + "電話:" + phone + chr(10) + chr(13)
mailstr=mailstr + "地址:" + address + chr(10) + chr(13)
mailstr=mailstr + "傳真:" + fax + chr(10) + chr(13)
mailstr=mailstr + "內容:" + content + chr(10) + chr(13)
Set msg = Server.CreateObject("JMail.Message")
msg.silent = true
msg.Logging = true
msg.Charset = "gb2312"
msg.MailServerUserName = "online-email@163.com" '輸入smtp服務器驗證登陸名
msg.MailServerPassword = "email123" '輸入smtp服務器驗證密碼 (用戶Email帳號對應的密碼)
msg.From = "online-email@163.com"
msg.FromName = myname '發件人姓名
msg.AddRecipient co_email '收件人Email
msg.AddRecipientBCC "napoleon@ibw.com.cn" '密件傳送'
msg.Subject = "氯堿化工網站留言" '信件主題
msg.Body = "主題:"+topic++chr(10)+chr(13)+mailstr '正文
msg.Send ("smtp.163.com") 'smtp服務器地址(企業郵局地址)
set msg = nothing
rs.Open "contact",cn,3,3
rs.AddNew
rs("title")=topic
rs("email")=email
rs("myname")=myname
rs("corpname")=corpname
rs("phone")=phone
rs("fax")=fax
rs("content")=content
rs("address")=address
rs("creadate")=now()
rs("sysemail")=co_email
rs.Update
rs.Close
Response.Redirect("contact.asp?flag=1")
end if
%>
<!-- #include file="begin.asp" -->
<TABLE WIDTH="778" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR VALIGN="TOP">
<TD WIDTH="180">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD><IMG SRC="../images/title_inside.gif" WIDTH="180" HEIGHT="32"></TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD BGCOLOR="#cccccc"><IMG SRC="../images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
</TR>
<TR>
<TD bgcolor="efefef" ALIGN="RIGHT" style="font-size:12px;line-height:20px">
Address:<%=co_address%><BR>
Email:<a href="mailto:<%=co_email%>"><%=co_email%></a><BR>
Phone:<%=co_phone%><BR>
Fax:<%=co_fax%><BR>
Zip:<%=co_zip%><BR>
</TD>
</TR>
<TR>
<TD BGCOLOR="#cccccc"><IMG SRC="../images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</TABLE>
</TD>
<TD WIDTH="1" BGCOLOR="#9C9A9C"><IMG SRC="../images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
<TD>
<P><IMG SRC="../images/english/contact_tp.jpg" WIDTH="597" HEIGHT="57"></P>
<%if flag="1" then%>
<table width="70%" border="0" cellspacing="0" cellpadding="0" align="center" valign=middle>
<tr>
<td style="font-size:12pt;color:ff0000;" height=30><b>Success!<br></b></td>
</tr>
</table>
<%else%>
<br>
<%end if%>
<TABLE WIDTH="90%" BORDER="0" CELLSPACING="0" CELLPADDING="0" VALIGN=top>
<tr><td width=30> </td><td style="font-size:12px;color:navy">
Please fill the following form and click Submit.
</TD></TR>
</TABLE>
<TABLE WIDTH="90%" BORDER="0" CELLSPACING="0" CELLPADDING="0" VALIGN=top STYLE="line-height:200%">
<form name=contactform method="post" action="contact.asp" onsubmit="return checkcontact(contactform)" autocomplete = "off">
<TR>
<TD CLASS="font1" width=120 align=right>Topic:</TD><td width=10> </td>
<TD>
<INPUT TYPE="text" NAME="topic" MAXLENGTH=60 SIZE=40 class=input>
</TD>
</TR>
<TR>
<TD CLASS="font1" width=120 align=right>Email:</TD><td width=10> </td>
<TD>
<INPUT TYPE="text" NAME="email" MAXLENGTH=50 SIZE=40 class=input>
</TD>
</TR>
<TR>
<TD CLASS="font1" width=120 align=right>Your name:</TD><td width=10> </td>
<TD>
<INPUT TYPE="text" NAME="myname" MAXLENGTH=30 SIZE=30 class=input>
</TD>
</TR>
<TR>
<TD CLASS="font1" width=120 align=right>Company Name:</TD><td width=10> </td>
<TD>
<INPUT TYPE="text" NAME="corpname" MAXLENGTH=80 SIZE=40 class=input>
</TD>
</TR>
<TR>
<TD CLASS="font1" width=120 align=right>Address:</TD><td width=10> </td>
<TD>
<INPUT TYPE="text" NAME="address" MAXLENGTH=80 SIZE=40 class=input>
</TD>
</TR>
<TR>
<TD CLASS="font1" width=120 align=right>Telphone:</TD><td width=10> </td>
<TD>
<INPUT TYPE="text" NAME="phone" MAXLENGTH=40 SIZE=40 class=input>
</TD>
</TR>
<TR>
<TD CLASS="font1" width=120 align=right>Fax:</TD><td width=10> </td>
<TD>
<INPUT TYPE="text" NAME="fax" MAXLENGTH=30 SIZE=30 class=input>
</TD>
</TR>
<TR>
<TD CLASS="font1" width=120 align=right>Content:</TD><td width=10> </td>
<TD>
<TEXTAREA ROWS=10 COLS=60 NAME=content CLASS="input"></TEXTAREA>
</TD>
</TR>
<TR>
<TD ALIGN=center HEIGHT=50 VALIGN=middle> </TD><td width=10> </td>
<TD HEIGHT=30 VALIGN=middle>
<input type=image src="../images/english/btn_submit.gif" WIDTH="73" HEIGHT="17" BORDER="0">
<A HREF="JavaScript:document.contactform.reset();"><IMG SRC="../images/english/btn_reset.gif" WIDTH="73" HEIGHT="17" BORDER="0"></A></TD>
</TR>
</form>
</TABLE>
<P> </P>
</TD>
</TR>
</TABLE>
<!-- #include file="end.asp" -->
<!-- #include file="func.asp" -->
<script language=Javascript>
function checkcontact(form)
{
var flag=true;
if(form("topic").value==""){alert("Please Input Topic!");form("topic").focus();return false;}
if(form("myname").value==""){alert("Please Input Your Name!");form("myname").focus();return false;}
if (flag==true) {flag=checkchar(form("topic").value)}
if (flag==true) {flag=checkchar(form("email").value)}
if (flag==true) {flag=checkchar(form("myname").value)}
if (flag==true) {flag=checkchar(form("address").value)}
if (flag==true) {flag=checkchar(form("corpname").value)}
if (flag==true) {flag=checkchar(form("phone").value)}
if (flag==true) {flag=checkchar(form("fax").value)}
if (flag==true) {flag=checkchar(form("content").value)}
return flag;
}
function checkchar(str)
{
str=str.toLowerCase()
oldstr=str
str="2"+str
if (str.search("<"+"%")>0)
{
window.alert("("+oldstr+") is Valid ,Please Check!");
return false;
}
if (str.search("<scrip"+"t")>0)
{
window.alert("("+oldstr+") is Valid ,Please Check!");
return false;
}
return true;
}
</script>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -