📄 register.asp
字号:
<%@ language=VBScript %>
<!--#include file="setup.asp"-->
<%
if Request("menu") = "register" then
call setup()
else call index()
end if
sub index()
%>
<html>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=gbook_name%></title>
<link rel="stylesheet" href="style.css">
</head>
<body bgcolor="#C8C8C8">
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="500">
<tr>
<td width="100%" bgcolor="#EFEFEF">
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center" background="images/table.gif"><b><font color=ffffff><%=gbook_name%></font></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF">
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="75%" class="shadow">当前位置:<a href=<%=url%>><%=name%></a> - <a href=index.asp>留言首页</a> - 注册向导</td>
<td width="25%" class="shadow" align="right">进入时间:<%=time%></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<table cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%" height="3">
<tr>
<td width="100%"></td>
</tr>
</table>
<div align="center">
<center>
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="500">
<form name="form" method="post" action="register.asp">
<input type=hidden name=menu value=register>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">留言本名称</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="gbook_name" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">管理员密码</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="password" size="20" name="password" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">主页的名称</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="name" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">网站的地址</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="url" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" value="http://"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">长度的限制</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="bodymax" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">每页留言数</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="pagesize" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">你的IP地址</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" style="width: 200; height: 18" disabled="true" value="<%=Request.ServerVariables("REMOTE_ADDR")%>"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">请点击注册</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="submit" value="注册" name="ok" style="width: 50; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''"></td>
</tr>
</form>
</table>
</center>
</div>
<%
call htmlend()
Response.End
end sub
sub setup()
gbook_name=Server.htmlencode(Request.form("gbook_name"))
password=Request.form("password")
name=Server.htmlencode(Request.form("name"))
url=Request.form("url")
bodymax=Request.form("bodymax")
pagesize=Request.form("pagesize")
setup_ip=Request.ServerVariables("REMOTE_ADDR")
if gbook_name = "" then
message="留言本名称不能为空!\n"
end if
if password = "" then
message=message&"管理员口令不能为空!\n"
end if
if name = "" then
message=message&"您的网站名称必须填写!\n"
end if
if url = "" then
message=message&"您的网站地址必须填写!\n"
end if
if bodymax = "" then
message=message&"您不能把留言内容大小限制设置为空!\n"
end if
if pagesize = "" then
message=message&"每页显示的留言数必须填写!\n"
end if
if message<> "" then
call error(""&message&"")
Response.end
end if
sql = "select * from admin where gbook_name='"&gbook_name&"'"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql,conn,3,3
if Rs.eof or Rs.bof then
Rs.addnew
Rs("gbook_name")=gbook_name
Rs("password")=password
Rs("name")=name
Rs("url")=url
Rs("bodymax")=bodymax
Rs("pagesize")=pagesize
Rs("setup_ip")=setup_ip
Rs("setup_time")=now
Rs.update
else
message=message&"该留言本已存在,请换一个留言本名称!\n"
call error(""&message&"")
end if
Rs.close
sql = "select * from admin where gbook_name='"&gbook_name&"'"
Rs.open sql,conn,3,3
userid=Rs("id")
Rs.close
set Rs = nothing
conn.close
set conn = nothing
Response.redirect "success.asp?userid="&userid&"&bookname="&gbook_name
Response.End
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -