📄 write.asp
字号:
<!--#include file="articleconn.asp"-->
<%
'叛断Session变量是否超时
if isempty(session("u_id")) or session("u_id")="" then
send_name=""
send_mail=""
recv_name=""
recv_mail=""
else
'叛断此用户是否已经注册
Set conn1 = Server.CreateObject("ADODB.Connection")
DBPath1 = Server.MapPath("../isi/xlist.asp")
conn1.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath1
Set rs_lar = Server.CreateObject("ADODB.Recordset")
sql="select * from larchives where user_id =" & session("u_id")
rs_lar.open sql,conn1,3,2
if rs_lar.eof and rs_lar.bof then
send_name=""
send_mail=""
recv_name=""
recv_mail=""
else
send_name=rs_lar("netname")
send_mail=rs_lar("email")
if isempty(request("youid")) or request("youid")="" then
recv_name=""
recv_mail=""
else
rs_lar.close
sql="select * from larchives where user_id =" & request("youid")
rs_lar.open sql,conn1,3,2
if rs_lar.eof and rs_lar.bof then
recv_name=""
recv_mail=""
else
recv_name=rs_lar("netname")
recv_mail=rs_lar("email")
end if
end if
end if
rs_lar.close
end if
%>
<html>
<%
response.buffer=false
dim sql
dim rs
dim t_id,typeid
typeid=0
t_id=request("id")
set rs=server.createobject("adodb.recordset")
sql="update learning set hits=hits+1 where articleID="&t_id
rs.open sql,conn,1,1
rs.close
%>
<script languange="JAVASCRIPT">
<!--
function validEmail(email) {
invalidChars = " /:;"
if (email == "") {
return false
}
for (i=0; i<invalidChars.length; i++) {
badChar = invalidChars.charAt(i)
if (email.indexOf(badChar,0) != -1) {
return false
}
}
atPos = email.indexOf("@",1)
if (atPos == -1) {
return false
}
periodPos = email.indexOf(".",atPos)
if (periodPos == -1) {
return false
}
if (periodPos+3 > email.length) {
return false
}
return true
}
function submitIt(form) {
if (!validEmail(form.replyto.value) &&
!validEmail(form.mail.value) ||
!validEmail(form.replyto.value) ||
!validEmail(form.mail.value)) {
alert("请检查一下您的电子邮件地址。")
if (!validEmail(form.replyto.value) &&
!validEmail(form.mail.value)) {
form.mail.focus()
form.mail.select() }
else {
if (!validEmail(form.mail.value)) {
form.mail.focus()
form.mail.select()
}
else {
if (!validEmail(form.replyto.value)) {
form.replyto.focus()
form.replyto.select()
}
}
}
return false
}
return true
}
-->
</script>
<% conn.close
set conn=nothing
%>
<link rel="stylesheet" href="style.css" type="text/css">
<body bgcolor="#9E9E9E">
<table border="0" width="500" cellspacing="1" cellpadding="10" align="center" bgcolor="#666666">
<tr>
<td bgcolor="#FAFAF1">
<form action="addcard.asp?id=<%=t_id%>" method="post" name="pick" onsubmit="return submitIt(this)">
<table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="30">
<div align="center"> </div>
</td>
</tr>
</table>
<br>
<table border="0" width="468" cellpadding="5" cellspacing="1" bgcolor="#808F61" align="center">
<tr>
<td height="15" bgcolor="#FAFAF1" colspan="2">
<div align="center"><b><font color="#424D2F">填写点歌卡</font></b></div>
</td>
</tr>
<tr>
<td height="15" bgcolor="#FAFAF1" width="19%"><font color="#FF0080"></font>对方姓名:
<font color="#808000"></font></td>
<td height="15" bgcolor="#FAFAF1" width="81%">
<input type="text" size="32" maxlength="60" name="toname" value="<%=recv_name%>" class="put">
</td>
</tr>
<tr>
<td width="19%" height="15" bgcolor="#FAFAF1"><font color="#FF0080"></font>对方Email:</td>
<td width="81%" height="15" bgcolor="#FAFAF1">
<input type="text" size="32" maxlength="60" name="mail" value="<%=recv_mail%>" class="put">
</td>
</tr>
<tr>
<td width="19%" height="15" bgcolor="#FAFAF1"><font color="#FF0080"></font>您的大名:</td>
<td width="81%" height="15" bgcolor="#FAFAF1">
<input type="text" size="32" maxlength="60" name="myname" value="<%=send_name%>" class="put">
</td>
</tr>
<tr>
<td width="19%" height="15" bgcolor="#FAFAF1"><font color="#FF0080"></font>您的Email:</td>
<td width="81%" height="15" bgcolor="#FAFAF1">
<input type="text" size="32" maxlength="60" name="replyto" value="<%=send_mail%>" class="put">
</td>
</tr>
<tr>
<td width="19%" height="25" bgcolor="#FAFAF1">祝福寄语: </td>
<td width="81%" height="25" bgcolor="#FAFAF1">
<textarea name="message" rows="5" cols="50" class="put"></textarea>
</td>
</tr>
</table>
<div align="center">选择预览或发送:
<input type="radio" checked name="method" value="preview_card">
预览
<input type="radio" name="method" value="send_card">
发送 </div>
<p align="center"><input type="submit" value="确定" class="put1">
<input type="reset" value="重写" class="put1">
</form>
</td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -