登录页面制作
怎样用 myeclipse和数据库做一个简单的登录界面,用来完成对数据库的操作
首先用myeclipse创建一个web 工程 这是jsp登录页面 <body> <% request.setCharacterEncoding("GBK"); String name=request.getParameter("文件名"); if(name.equals("sa")){ session.setAttribute("UserName",name); response.sendRedirect("文件名"); } else{ response.sendRedirect("文件名"); } %> </body> 连接数据库文件 public class ConnectionManager { private static final String DRIVER_CLASS = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; private static final String DATABASE_URL = "jdbc:sqlserver://localhost:1433;DatabaseName="数据库名“; private static final String DATABASE_USRE = "sa"; private static final String DATABASE_PASSWORD = "sa"; /** * 返回连接 * * @return Connection */ public static Connection getConnection() { Connection dbConnection = null; try { Class.forName(DRIVER_CLASS); dbConnection = DriverManager.getConnection(DATABASE_URL, DATABASE_USRE, DATABASE_PASSWORD); } catch (Exception e) { e.printStackTrace(); } return dbConnection; } /** * 关闭连接 * * @param dbConnection * Connection */ public static void closeConnection(Connection dbConnection) { try { if (dbConnection != null && (!dbConnection.isClosed())) { dbConnection.close(); } } catch (SQLException sqlEx) { sqlEx.printStackTrace(); } } /** * 关闭结果集 */ public static void closeResultSet(ResultSet res) { try { if (res != null) { res.close(); } } catch (SQLException e) { e.printStackTrace(); } } /** * 关闭语句 */ public static void closeStatement(PreparedStatement pStatement) { try { if (pStatement != null) { pStatement.close(); } } catch (SQLException e) { e.printStackTrace(); } } }
怎么在dreamweaver做一个登录页面?
①先新建一个html页面取名为index.html这个为首页,在BODY里面写上<a href="Login.html"/>登陆</a>(一般网站上的登陆按钮不是button而是a标签,只是加一些样式就可以和button按钮一样了,href就是你想点击后跳转到得页面地址)。②再建立一个HTML页面取名为Login.html这个是登陆的界面在body里写上 <label>用户名</label> <input type="text" /><br /> <label>密码</label> <input type="password" /><a href="这里写第三个页面的地址">注册</a>上面就是登陆页面让你输入用户名和密码。③建立一个html作为注册页面,在body里面写上 <label>用户名</label> <input type="text" /><br /> <label>密码</label> <input type="text" /><br /> <label>确认密码</label> <input type="password" /> <input type="button" value="注册"/>以上就是在网站中常看到的点击登陆弹出页面,点击注册弹出页面的代码了。但是这只是html代码,如果要想验证那么就要涉及的数据库的知识了。希望可以帮到你,希望采纳!
怎样用div+css制作一个登录页面
用div+css制作一个登录页面,首先需要做的就是将这个登录界面的布局给构想好,然后在使用div去布局出来,一般都要结合表单,因为是需要和数据库结合的,至于的具体的界面,看下代码:<html><head><meta charset="UTF-8"><title>淘宝登录</title><link rel="stylesheet" type="text/css" href="../static/css/index.css" /><script type="text/javascript"> <{if $message !=''}> alert("<{$message}>"); <{/if}></script></head><body> <div id="logo"> <div class="logotop"> <div class="yanz"> <h2>登录</h2> <form action="logo.php" method="post"> <span style="display:block; height:27px; width:27px; background-image:url(../static/images/logozh.jpg); float:left;"></span> <input type="text" name="uname" style="height:26px"/><br/> <span style="display:block; height:27px; width:27px; background-image:url(../static/images/logomm.jpg); float:left;"></span> <input type="password" name="pwd" style="height:26px"/> <p><a href="">忘记登录密码?</a></p> <input type="submit" value="" style="width:254px; height:37px; background-image:url(../static/images/logodl.jpg); cursor: pointer;"/> </form> </div> </div></div> </body></html>这个代码有些图片的地址,需要根据要求去改,这些是我自己写的,然后就是传输的文件,action那,接受的文件也是需要定义的。
用html代码做一个登录页面,在输入用户名和密码后显示 登录成功 这四个字,,代码已写好,可
用JS来实现,加个条件判定if(user="123456" || pwd="123456"){就跳转到某页面}
通过Html和Javascript制作一个静态的登录页面
<body><form name="login" onsubmit="javascript:return chkfrm(this);"> 用户名:<input type="text" name="username" onpropertychange="javascript:if(this.value.length>=8)this.form.userpwd.focus();"><br> 密码:<input type="password" name="userpwd"><br> <input type="submit" value="登录"> <input type="reset" value="重置"></form><script language="javascript">function chkfrm(o){ if(o.username.value==''){ alert('请输入用户名!'); return false; } if(o.userpwd.value==''){ alert('请输入密码!'); return false; } alert('登陆成功'); return false;}</script></body>
如何制作网页登陆界面?
<html><head></head><body><form>2文本框(用户名+密码)提交按钮 提交态页(asp\aspx\php\jsp)做判断</form></body></html>
请问能不能详细一点?
举个例子 <form action="a.php" method="post"><input type="text" name="username" ID="username"> //用户名<input type="password" name="password" ID="password">//密码<input type="submit" name="dosubmit" value="登录">//登录按钮</form>通过POST把用户名、密码传给a.phpPHP的写法就是取出$_POST['username'] $_POST['password']然后和数据库里的值对比,正确的话,可以去数据库里取出名字(不是用户名)然后弹出框显示出来,否则提示登录失败
本人是非常菜的菜鸟……sorry,请问POST是什么东西?或者请把完整代码给我!sorry……
html的代码 (action="a.php" 这句根据实际情况看你POST给哪个页如果是ASP的就是action="a.asp",因为method="post" 所以直接就是POST的方法传值给PHP或者ASP文件了)<html><head></head><body><form action="a.php" method="post"><input type="text" name="username" ID="username"> //用户名<input type="password" name="password" ID="password">//密码<input type="submit" name="dosubmit" value="登录">//登录按钮</form></body></html>如果是PHP则a.php的代码$username=$_POST['username'] ;$password=$_POST['password'] ;然后去对接收的用户名和密码去和数据对比。如果是ASP则a.asp的代码username=request.FORM("username")password=request.FORM("password")然后去对接收的用户名和密码去和数据对比。具体的对数据库操作的代码自己来吧。。。。。。
如何用dreamweaver制作用户登录界面
1、插入一个div,设置为400x300px大小,背景色为米黄色,居中。2、输入标题文字和用户名、密码,调整位置。3、继续插入填写部分,插入--表单--文本域,所以需要输入内容的“框”都是文本域。设置用户名文本域ID为username,点击确定。4、继续同样的方式插入密码的文本域,设置ID为password。因为密码是非明文的,不需要显示,所以在属性面板里选择文本域的类型--密码。5、插入按钮。插入--表单--按钮,插入两个按钮,ID分别设置为login和reg。login按钮设置为登陆,reg按钮设置为注册。6、初始值是输入内容时,填写框显示的提示文字。7、这样一个简单的登陆界面就做好了。