📄 moddelviewwebsite.asp
字号:
<!--#include file="globe/DataConnect.asp"-->
<%
Dim UserName,Dtime,rs,sql,SubName,UserEmail,WebsiteName,WebsiteUrl,Introduce,Num,SubNum
ID=Request.QueryString("ID")
set rs=server.createobject("adodb.recordset")
sql="select * from Website where ID="&ID&" "
rs.open sql,cnn,1,1
UserName=rs("UserName")
DTime=rs("DTime")
SubName=rs("SubName")
UserEmail=rs("UserEmail")
WebsiteName=rs("WebsiteName")
WebsiteUrl=rs("WebsiteUrl")
Introduce=rs("Introduce")'Introduce=replace(rs("Introduce"),"<br>",vbCrlf)效果一样,不过如何防止其他符号没有涉及。
Num=rs("Num")
SubNum=rs("SubNum")
rs.close
Set rs=nothing
%>
<html>
<head>
<title>MoDelViewWebsite</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL="stylesheet" TYPE="text/css" HREF="globe/style.css">
<script language="vbscript">
function form1_onsubmit()
dim errormessage,error
dim FUserName,FUserMail,FWebsiteName,FIntroduce,FWebsiteUrl
dim error1,error2,error3,error4,error5,error6
FUserName=trim(cstr(form1.UserName.value))
FUserEmail=trim(cstr(form1.UserEmail.value))
FWebsiteName=trim(cstr(form1.WebsiteName.value))
FIntroduce=trim(cstr(form1.Introduce.value))
FWebsiteUrl=trim(cstr(form1.WebsiteUrl.value))
error=1
if FUserName="" or len(FUserName)>4 then
error1="同学,不要填空名,也不要超过输入框的长度!"
error=0
end if
if FUserEmail="" or len(FUserEmail)>30 then
error6="同学,邮箱不要填空的,也不要长过输入框的长度!"
error=0
end if
if FUserEmail<>"" then
JudgeEmail=false
for i=1 to len(FUserEmail)
if mid(FUserEmail,i,1)="@" then
JudgeEmail=true
end if
next
if JudgeEmail=false then
error2="同学,邮箱符号是不规范的!"
error=0
end if
end if
if FWebsiteName="" or len(FwebsiteName)>20 then
error3="同学,网站名称不要填空的,也不要超过输入框的长度!"
error=0
end if
if Len(FIntroduce)<20 or len(FIntroduce)>500 then
error4="同学,介绍内容太少,你也希望别人推荐的时候能介绍清楚些吧?太长也不行,别人就不会看你的介绍了!"
error=0
end if
if len(FWebsiteUrl)<10 or len(FWebsiteUrl)>50 then
error5="同学,麻烦认真点,不要太长也不要太短的地址,也不要包含‘http://’!"
error=0
end if
if error=0 then
if error1<>"" then
errormessage=error1&chr(13)&" "
end if
if error6<>"" then
errormessage=errormessage&error6&chr(13)&" "
end if
if error2<>"" then
errormessage=errormessage&error2&chr(13)&" "
end if
if error3<>"" then
errormessage=errormessage&error3&chr(13)&" "
end if
if error4<>"" then
errormessage=errormessage&error4
end if
if error5<>"" then
errormessage=errormessage&error5
end if
alert chr(13)&"错误在于:"&chr(13)&" "&errormessage
form1_onsubmit=false
else
form1_onsubmit=true
end if
end function
</script>
</head>
<body bgcolor="#ccddff">
<%'error handler
Dim error
error=request.querystring("error")
if error<>"" then
response.write error&"<br>"
end if
%>
<form name="form1" method="post" action="DoModViewWebsite.asp">
<input type="hidden" name="ID" value="<%=ID%>" >
<input type="hidden" name="SubName" value="<%=SubName%>" >
<input type="hidden" name="Num" value="<%=Num%>" >
<input type="hidden" name="SubNum" value="<%=SubNum%>" >
<div id="Layer1" style="position:absolute; left:31px; top:20px; width:536px; height:220px; z-index:1">
<table width="103%" border="1" height="220" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellspacing="0">
<TR> <td colspan="4" height="35">
<P align="center"><font color=#FF0000'>不是这个网站的推荐人最好不要来这里!很危险!请点击</font><A href='list.asp?Num=<%=Num%>&SubName=<%=SubName%>&SubNum=<%=SubNum%>'>
<返回></a></P>
</TD></tr>
<tr>
<td colspan="4" height="10">
<div align="left"><font color="#0000CC">修改该推荐</font></div>
</td>
</tr>
<tr>
<td width="14%" height="30"><font color="#339933">推荐人</font></td>
<td width="20%" height="30">
<input type="text" name="UserName" value="<%=UserName%>" size=8>
</td>
<td width="15%" height="30"><font color="#339933">E-Mail</font></td>
<td width="50%" height="30">
<input type="text" name="UserEmail" Value="<%=UserEmail%>" size="30">
</td>
</tr>
<tr>
<td width="14%" height="34"><font color="#339933">网站名</font></td>
<td height="34" colspan="3">
<input type="text" name="WebsiteName" value="<%=WebsiteName%>" size="40">
</td>
</tr>
<tr>
<td width="14%" height="10">
<p> <font color="#339933"> 介</font></p>
<p> </p>
<p><font color="#339933"> 绍</font></p>
</td>
<td height="10" colspan="3">为了大家,请认真填写,如特点,评价,建议等,不能少于20个字:
<textarea name="Introduce" rows="4" cols="62"><%=Introduce%></textarea>
</td>
</tr>
<tr>
<td width="14%" height="34"><font color="#339933">网站地址</font></td>
<td height="34" colspan="3">
Http://<input type="text" name="WebsiteUrl" value="<%=WebsiteUrl%>" size="50">
</td>
</tr>
</table>
</div>
<div id="Layer2" style="position:absolute; left:153px; top:280px; width:270px; height:37px; z-index:2">
<input type="submit" name="Submit" value="修 改">
<input type="reset" name="submit" value="复 原">
</div>
</form>
<div id='layer1' style='position:absolute;width:555px;top:320px;left:31px'>
<TABLE bgColor=#ffffff border=1 borderColor=#000000 borderColorDark=#ffffff borderColorLight=#000000 cellSpacing=0>
<TBODY><TR><TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff borderColorLight=#000000 height=10 width=555>
<div align="left"><font color="#0000CC">删除该推荐</font></div>
</TD></tr>
<TR><TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff borderColorLight=#000000 height=25 width=555>
<P align="center"><A href='DoDelViewWebsite.asp?ID=<%=ID%>&SubName=<%=SubName%>&Num=<%=Num%>&SubNum=<%=SubNum%>'>
<确定删除></a></P>
</TD></tr>
</tbody></table></div>
<!--#include file="globe/DataClose.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -