dreamweaver做用户登录界面

想用dreamweaver做用户登录界面,但是不连接数据库,就一个用户就可以,请大家帮下忙,代码和教程都可以!
补充一下:如果可以作到局部页面做登录是最好的!我把用户帐号和密码的输入的文本域和按钮都做到了一个布局表格里,登录后只有布局表格里的页面改变。
重点是不需要数据库,也不要注册!要用框架,具体点的方法,或者教程的URL

我的只是独立的。你自己试着组合下:
1.<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢迎光临</title>
</head>
<%
Session.Timeout=10
if session("pass")<>"action1" then
response.Redirect("logon.asp")
Response.End
end if
%>
<body>
<h1 align="center"> </h1>
<h1 align="center">登录成功! </h1>
</body>
</html>

2.<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册结果</title>
</head>
<!--#include file=security.asp-->
<body>
<p> </p>
<p> </p>
<h2 align="center">
<%
dim db '以下连上数据库,建立一个Connection对象实例db
set db=Server.Createobject("ADODB.Connection")
db.Open "DBQ="&Server.Mappath("maindata.asa")&";DRIVER={Microsoft Access Driver (*.mdb)};"

dim strSql,rs,strSql1
strSql="Select * From user"
set rs=db.execute(strSql)

dim a1,a2,b2,c2,a3,a4,a5,a6,i
a1=Request.Form("user")
a2=Request.Form("password")
b2=Request.Form("password2")
a3=Request.Form("sex")
a4=Request.Form("love")
a5=Request.Form("career")
a6=Request.Form("introduction")
'下面是检查用户名和密码是否填写完整
if trim(a1)="" or trim(a2)="" then
Response.Write "对不起,用户名、密码必须填写!<p>"
Response.Write "<a href='login.asp' >重填</a>"
Response.End
end if
'下面将注册用户名,逐条与数据库是记录的用户名对比。如果数据库中已经有了,提示用户不能再注册。
do while not rs.Eof
i=rs("user_name")
if trim(a1)=trim(i) then
Response.Write "用户名重名<p>"
Response.Write "<a href='login.asp' >重填</a>"
Response.End
end if
rs.movenext
loop
'下面是检查密码与确认密码是否相同
if a2 <> b2 then
Response.Write "密码确认不正确<p>"
Response.Write "<a href='login.asp' >重填</a>"
Response.End
end if
c2=encrypt(a2)
'下面是将注册信息添加到数据库中
strsql="insert into user(user_name,password,sex,love,career,introduction,submit_date) Values('"& a1 & "', '"& c2 &"', '" & a3 &"','"& a4 & "','"& a5 & "','"& a6 & "', #" & now() & "#)"
db.Execute(strsql)
%>
</h2>
<h2 align="center" >
<%
Response.Write "注册成功!<p>请记牢用户名和密码!"
%>
</h2>
<p align="center" class="base-4" > </p>
<table width="121" height="35" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="middle">
<td><script language="JavaScript">
function shutwin(){
window.close();
return;}
</script> <a href="javascript:shutwin();">关闭本窗口</a></td>
</tr>
</table>
<p align="center" > </p>
<p>

</body>
</html>

3.<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册</title>
</head>

<body>
<p> </p><p> </p>
<table width="600" border="0" align="center">
<tr>
<td><h2 align="center">用户注册</h2>
<form name="form1" method="post" action="insert.asp">
<table width="67%" border="1" align="center" cellspacing="0" bordercolor="#0000FF">
<tr>
<th width="25%">用户名</th>
<td width="75%"><input type="text" name="user">
** 必须填写</td>
</tr>
<tr>
<th>密码</th>
<td><input type="password" name="password" >
**</td>
</tr>
<tr>
<th width="25%">确认密码</th>
<td width="75%"><input type="password" name="password2">
**</td>
</tr>
<tr>
<th width="25%">性别</th>
<td width="75%"><input type="radio" name="sex" value="男">

<input type="radio" name="sex" value="女">
女</td>
</tr>
<tr>
<th width="25%">爱好</th>
<td width="75%"><input type="checkbox" name="love" value="音乐">
音乐
<input type="checkbox" name="love" value="计算机">
计算机</td>
</tr>
<tr>
<th width="25%">职业</th>
<td width="75%"><select name="career" size="1">
<option value=" " selected>请选择</option>
<option value="教育业">教育业</option>
<option value="金融业">金融业</option>
<option value="其他">其他</option>
</select></td>
</tr>
<tr>
<th width="25%">简介</th>
<td width="75%"><textarea name="introduction" cols="40" rows="2" wrasp="soft"></textarea></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" name="Submit" value="提交">

<input type="submit" name="teset" value="重写"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<h2 align="center"> </h2>
</body>
</html>

4.<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册</title>
</head>

<body>
<p> </p><p> </p>
<table width="600" border="0" align="center">
<tr>
<td><h2 align="center">用户登录</h2>
<form name="form1" method="post" action="validate.asp">
<table width="67%" border="1" align="center" cellspacing="0" bordercolor="#0000FF">
<tr>
<th width="25%">用户名</th>
<td width="75%"><input name="user" type="text" size="20">
</td>
</tr>
<tr>
<th>密码</th>
<td><input name="password" type="password" size="20" > </td>
</tr>

<tr>

<th> 附加码</th>
<td><input type="text" name="otherpwd" size="20" class="button1">

<%
dim temprnd '随机生成 附加码
Randomize
temprnd=cstr(Int((9999 - 1000 + 1) * Rnd() + 1000))
response.Write (temprnd)
%>
<input type="hidden" name="reotherpwd" value="<%=temprnd%>">
</td>
</tr>

<tr>
<th> </th>
<td><input type="submit" name="Submit" value="提交">

<input type="submit" name="teset" value="重写"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<h2 align="center"> </h2>
</body>
</html>

5.<%
function decrypt(dcode)
dim texts
dim i
for i=1 to len(dcode)
texts=texts & chr(asc(mid(dcode,i,2))-i)
next
decrypt=texts
end function
function encrypt(ecode)
Dim texts
dim i
for i=1 to len(ecode)
texts=texts & chr(asc(mid(ecode,i,2))+i)
next
encrypt = texts
end function
%>

6.<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file=security.asp-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登录网页</title>
</head>
<body>
<p> </p>
<p> </p>
<h2 align="center">
<%
rem 以下连上数据库,建立一个Connection对象实例db
dim db
set db=Server.Createobject("ADODB.Connection")
db.Open "DBQ="&Server.Mappath("maindata.asa")&";DRIVER={Microsoft Access Driver (*.mdb)};"
dim strSql,rs,strSql1
strSql="Select * From user"
set rs=db.execute(strSql)

dim a1,a2,nam,psw,otherpwd,reotherpwd
a1=Request.Form("user")
a2=Request.Form("password")
otherpwd=Request.Form("otherpwd")
reotherpwd=Request.Form("reotherpwd")

do while not rs.Eof
nam=rs("user_name")
rem 利用decrypt解密函数不原密码
psw=decrypt(rs("password"))
if reotherpwd<>otherpwd then
Response.Write "附加码不对!<p>"
Response.Write "<a href='logon.asp' >重新登录</a>"
Response.End
end if
rem 如果用户名、密码正确,登录成功,引导到另一张网页
if a1=nam and a2=psw then
session("pass")="action1"
response.Redirect("default.asp")
Response.End
end if
rs.movenext
loop
Response.Write "用户信息不正确<p>"
Response.Write "<a href='logon.asp' >重新登录</a>"
%>
</h2>

</body>
</html>
温馨提示:内容为网友见解,仅供参考
第1个回答  2015-12-24

dw中制作登录界面步骤:
1、插入一个div,设置为400x300px大小,背景色为米黄色,居中。
 2、输入标题文字和用户名、密码,调整位置。
 3、继续插入填写部分,插入--表单--文本域,所以需要输入内容的“框”都是文本域。设置用户名文本域ID为username,点击确定。
 4、继续同样的方式插入密码的文本域,设置ID为password。因为密码是非明文的,不需要显示,所以我们在属性面板里选择文本域的类型--密码。
 5、插入按钮。插入--表单--按钮,插入两个按钮,ID分别设置为login和reg。login按钮设置为登陆,reg按钮设置为注册。
5、初始值是我们未输入内容时,填写框显示的提示文字。
效果图:

第2个回答  2007-06-05
那你得用框架!

你单独做一个页面为登录的,然后以框架的形式插入到页面中,密码处理就是登录的那个里面做就行
相似回答