㈠ 用户登录 asp+sql源码
数据库建立一个表admin 3个列:Username Passwd oskey(用户级别)
ODBC数据源创建一个sql的数据源与你建立的数据库连上。
conn.asp
<%
set conn=server.createobject("adodb.connection")
conn.connectionstring="DSN=ccsw;uid=sa;pwd=1234"
conn.open
%>
index.asp
<html>
<head>
<title>管理登录</title>
<link rel="stylesheet" href="style.CSS">
<style type="text/css">
<!--
.style1 {color: #9966FF}
.style2 {
font-size: 12pt;
font-weight: bold;
color: #9966FF;
}
.style3 {
font-size: 12pt;
color: #0033CC;
}
.style4 {color: #0000CC}
-->
</style>
</head>
<body>
<div align="center"><center>
<table border="0" cellspacing="1" width="90%">
<tr>
<td> <form method="post" action="chklogin.asp">
<table width="300" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="30" colspan="2" align="right"><div align="center" class="style1 style3"><strong>管理登录</strong></div></td>
</tr>
<tr>
<td width="33%" align="right" height="30"><span class="style4">用户名:</span></td>
<td width="67%">
<input name="UserName" maxlength="20" class="smallInput" size="20">
</td>
</tr>
<tr>
<td width="33%" align="right" height="30"><span class="style4">密 码:</span></td>
<td width="67%">
<input type="password" name="Passwd" maxlength="16" class="smallInput"
size="20">
</td>
</tr>
<tr>
<td colspan="2" height="15"></td>
</tr>
</table>
</td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="31" bgcolor="#9999FF">
<input type="submit" name="Submit" value="确定" class="buttonface">
<input type="reset" name="Submit2" value="重写" class="buttonface"></td>
</tr>
</table>
</form>
<p align="center">后台登录</td>
</tr>
</table>
</center></div>
</body>
</html>
检查用户界面:
<!--#include file=articleconn.asp-->
<%
dim rs
UserName1=request.form("UserName")'获得登录界面输入的用户名
Passwd1=request.form("PassWd")''获得登录界面输入的密码
set rs=server.CreateObject("ADODB.RecordSet")'建立数据库连接
rs.open "select * from admin where UserName='" & UserName1 & "' and passwd='"&passwd1&"'",conn,1 '查询该用户名和密码是否存在
if rs.eof or rs.bof then '当没有符合筛选结果时,则执行下面的句子
response.write "<script language=javascript>"
response.write "alert('用户或密码不对!');"
response.write "javascript:history.go(-1);"
response.write "</script>" '用javascript脚本提示用户
else '如果符合条件的时候
session("UserName")=RS("Username") '新建session,值等于表单传来的用户名
session("KEY")=rs("OSKEY")
response.write"<SCRIPT language=JavaScript>alert('登录成功');"
response.write"this.location.href='admin.asp';</SCRIPT>"
end if '结束if语句
%>
㈡ asp.net C# 登陆页面 源码
程序不复杂,去网上当一个
㈢ 谁有会员登录系统网页代码+mysql数据库(5页就好)
给她钱了
㈣ php写一个登陆界面并且保存到数据库,实现1天免登陆,求源码
login.php
<!doctype html public "-//W3C//dtd html 4.01 transitional//en" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<form name="form1" method="post" action="confirm.php">
<p>用户名:<input type="text" name="user"></p>
<p>密码:<input type="password" name="pwd"></p>
<p><input type="submit" name="b1"></p>
</form>
</body>
</html>
㈤ C#如何运用ACCSEE数据库制作一个登录、注册的界面,代码是怎么样的
不知道你有没有使用过SQL Server数据库,其实语句都是一样的呀,只不过链接的数据库的字符串不一样。
SQL Server数据库:string connectionString = "Data Source=localhost; Initial catalog=JXC_DB; User Id=sa; Password=sa";
Access数据库:string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="Access数据库路径";
还有,就是操作数据库的命名空间和类有所区别。如
SQL Server数据库:using System.Data.SqlClient;
Access数据库:using System.Data.OleDb;
仅此而已
㈥ 求一个visual studio2012编写登录界面与sql server2012数据库连接的源码
网上很多这样的代码吧,网络一下sqlconnection你就发现新大陆了。
㈦ 求c#注册登录界面源代码(全部包括SQL数据库)
我写了一个登录的程序,界面也做的还可以,写了号几天呢。20分把这么多代码写给你不太可能吧,这里也放不下
㈧ 求html登陆界面代码,要连接数据库的
<p
style="font-size:
45px;
color:
#FF9;
font-weight:
bold;
text-align:
center;">用户登录
</p>
<form
name="form1"
method="post"
action="loginok.asp"><table
width="292"
align="center">
<tr>
<td
align="center">用户名:
<label
for="user"></label></td>
<td><input
name="user"
type="text"
id="user"
size="15"></td>
</tr>
<tr>
<td
align="center">密码:
<label
for="psw2"></label></td>
<td><input
name="psw1"
type="password"
id="psw1"
size="15"></td>
</tr>
<tr>
<td
align="center"></td>
<td><input
type="submit"
name="button"
id="button"
value="登录">
<input
type="reset"
name="button2"
id="button2"
value="重置"></td>
</tr>
</table>
</form>
这是连接数据库那部分的代码,自己做的。下面是效果图。之后还要做个登录成功的跳转页面。还有前面有人提了,动态网页要保存为.asp格式。
更多资料可以参考:www.wm23.cn/jopong
㈨ jsp登陆界面源代码
1、login.jsp文件
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>登录页面</title>
</head>
<body>
<form name="loginForm" method="post" action="judgeUser.jsp">
<table>
<tr>
<td>用户名:<input type="text" name="userName" id="userName"></td>
</tr>
<tr>
<td>密码:<input type="password" name="password" id="password"></td>
</tr>
<tr>
<td><input type="submit" value="登录" style="background-color:pink"> <input
type="reset" value="重置" style="background-color:red"></td>
</tr>
</table>
</form>
</body>
</html>
2、judge.jsp文件
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>身份验证</title>
</head>
<body>
<%
request.setCharacterEncoding("GB18030");
String name = request.getParameter("userName");
String password = request.getParameter("password");
if(name.equals("abc")&& password.equals("123")) {
3、afterLogin.jsp文件
%>
<jsp:forward page="afterLogin.jsp">
<jsp:param name="userName" value="<%=name%>"/>
</jsp:forward>
<%
}
else {
%>
<jsp:forward page="login.jsp"/>
<%
}
%>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>登录成功</title>
</head>
<body>
<%
request.setCharacterEncoding("GB18030");
String name = request.getParameter("userName");
out.println("欢迎你:" + name);
%>
</body>
</html>
(9)免费登录界面数据库源码扩展阅读:
java web登录界面源代码:
1、Data_uil.java文件
import java.sql.*;
public class Data_uil
{
public Connection getConnection()
{
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
}catch(ClassNotFoundException e)
{
e.printStackTrace();
}
String user="***";
String password="***";
String url="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=***";
Connection con=null;
try{
con=DriverManager.getConnection(url,user,password);
}catch(SQLException e)
{
e.printStackTrace();
}
return con;
}
public String selectPassword(String username)
{
Connection connection=getConnection();
String sql="select *from login where username=?";
PreparedStatement preparedStatement=null;
ResultSet result=null;
String password=null;
try{
preparedStatement=connection.prepareStatement(sql);
preparedStatement.setString(1,username);
result=preparedStatement.executeQuery();//可执行的 查询
if(result.next())
password=result.getString("password");
}catch(SQLException e){
e.printStackTrace();
}finally
{
close(preparedStatement);
close(result);
close(connection);
}
System.out.println("找到的数据库密码为:"+password);
return password;
}
public void close (Connection con)
{
try{
if(con!=null)
{
con.close();
}
}catch(SQLException e)
{
e.printStackTrace();
}
}
public void close (PreparedStatement preparedStatement)
{
try{
if(preparedStatement!=null)
{
preparedStatement.close();
}
}catch(SQLException e)
{
e.printStackTrace();
}
}
public void close(ResultSet resultSet)
{
try{
if(resultSet!=null)
{
resultSet.close();
}
}catch(SQLException e)
{
e.printStackTrace();
}
}
}
2、login_check.jsp:文件
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>验证用户密码</title>
</head>
<body>
<jsp:useBean id="util" class="util.Data_uil" scope="page" />
<%
String username=(String)request.getParameter("username");
String password=(String)request.getParameter("password");
if(username==null||"".equals(username))
{
out.print("<script language='javaScript'> alert('用户名不能为空');</script>");
response.setHeader("refresh", "0;url=user_login.jsp");
}
else
{
System.out.println("输入的用户名:"+username);
String passwordInDataBase=util.selectPassword(username);
System.out.println("密码:"+passwordInDataBase);
if(passwordInDataBase==null||"".equals(passwordInDataBase))
{
out.print("<script language='javaScript'> alert('用户名不存在');</script>");
response.setHeader("refresh", "0;url=user_login.jsp");
}
else if(passwordInDataBase.equals(password))
{
out.print("<script language='javaScript'> alert('登录成功');</script>");
response.setHeader("refresh", "0;url=loginSucces.jsp");
}
else
{
out.print("<script language='javaScript'> alert('密码错误');</script>");
response.setHeader("refresh", "0;url=user_login.jsp");
}
}
%>
</body>
</html>
3、loginSucces.jsp文件
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<hr size="10" width="26%" align="left" color="green">
<font size="6" color="red" >登录成功 </font>
<hr size="10" width="26%" align="left" color="green">
</body>
</html>
4、user_login.jsp文件
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>登录界面</title>
</head>
<body background="C:Userswin8workspaceLoginimage\_10.jpg" >
<center>
<br><br><br><br><br><br>
<h1 style="color:yellow">Login</h1>
<br>
<form name="loginForm" action="login_check.jsp" method="post">
<table Border="0" >
<tr >
<td>账号</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="password">
</td>
</tr>
</table>
<br>
<input type="submit" value="登录" style="color:#BC8F8F">
</form>
</center>
</body>
</html>