<!--#include file="conn.asp"-->
<%
if request.Form("username")="" or request.form("password")="" then
response.Write("<script>alert('您好,不能为空 ');location.href='index.html';</script>")
end if
%>
<%
dim rs,sql,lyq,ekaida
lyq=request.form("username")
ekaida=request.form("password")
sql="select * from admin"
set rs=server.createobject("adodb.recordset")
rs.open sql,db,1,3
rs.addnew
rs("username")=lyq
rs("password")=ekaida
rs.update
rs.close
set rs=nothing
response.Write("<script>alert('您好,数据库写入成功,正在转入首页 ');location.href='index.html';</script>")
%>
---------------------------------------------------------------------------------------------------
<!--#include file="conn.asp"-->
<%
username=request.form("delnet")
if request.Form("delnet")="" then
response.Write("<script>alert('您好,请输入删除的用户名然后点击提 交!');location.href='index.html';</script>")
end if
%>
<%
set rs=server.createobject("adodb.recordset")
sql="delete * from admin where username='"&trim(request.form("delnet"))&"'"
rs.open sql,db,3,2
db.close
set db=nothing
%>
<%
response.Write("<script>alert('用户:"&username&"删除成功 ');location.href='index.html';</script>")
%>
-------------------------------------------------------------------------------
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sql="select * from admin order by id desc"
rs.open sql,db,1,1
%>
<%
do while not rs.eof
%>
<%=rs("username")%>
<%=rs("password")%>
<%
rs.movenext
loop
%>
-------------------------------------------------------------------------------
conn
--------------------------------
<%
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("data.mdb")
set db= Server.CreateObject("ADODB.Connection")
db.open connstr
%>
-------------------------------------------------------------------------------- 会员登陆代码
<%@ language="vbscript"%>
<%response.Expires = 0%>
<!--#include file="conn.asp"-->
<%
dim uid ,pwd
uid=request.Form("username")
pwd=request.Form("password")
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from user where password='"&pwd&"'"
rs.open sql,conn,1,1
if pwd<>RS("password") then
response.Write("<script>alert('您好,您的用户名或密码错误')</script>")
response.End()
else
session("test")="test"
response.redirect "http://www.zh365.com/ "
end if
rs.close
set rs=nothing
%>
asp添加数据记录写入,删除,查看实列
最新推荐文章于 2018-10-15 10:40:46 发布