静态网页的html固定登录模块

静态网页的html固定登录模块,第1张

可以实现,用js或者jquery,但是别人其实直接访问那个登录后的网页也可以访问。。

当然,也有点小办法,就是传递cookie进去,当然有点水平的人轻易破解就是了。。。

但是有点问题就是密码是写在js上面的,很容易就弄出来了。当然你也你可以用md5加密。

额大概只能想到这样了。你要是有分数的话可以给你写写玩玩,但是没什么用,一点没有保密性,没有服务器的话,页面永远都是在那的,我有一百种方法可以看到。。骗骗小白倒是可以··

管理员账号呢?

LoginInput.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%

String path = request.getContextPath()

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<base href="<%=basePath%>">

<title>My JSP 'LoginInput.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0">

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

<!--

<link rel="stylesheet" type="text/css" href="styles.css">

-->

</head>

<body><center>

<form action = Login.jsp>

用户名:<input type = text name = username><br/>

密码:<input type = password name = password/><br/>

<input type = Submit value = "登陆"/>

</form>

</center>

</body>

</html>

Login.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%

String path = request.getContextPath()

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<base href="<%=basePath%>">

<title>My JSP 'Login.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0">

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

<!--

<link rel="stylesheet" type="text/css" href="styles.css">

-->

</head>

<body>

<%

String username = request.getParameter("username")

String password = request.getParameter("password")

if(username.equals("adminstrator")&&password.equals("admin")){

//管理员登陆

}

else if(username.equals("admin")&&password.equals("admin")){

//普通用户登陆

}

%>

</body>

</html>

1、确认无误后,打开python编辑器pycharm,然后新建一个文件,叫做tkinter_t.py。

2、内容编辑完毕,确认无误后,点击pycharm编辑器最上方的run选项卡。然后再点击下方的run选项。

3、然后会d出一个窗口,让你选择需要运行的python文件,选择刚才创建的tkinter_t.py,然后就会开始执行。d出我们的测试窗口。

4、继续在基础上进行优化。优化后的命令总共分两段。

5、首先用Tk()这个模块创建一个窗口windows,然后定义一个按钮button,按钮的名称是press,按下去以后的响应命令command是刚才定义的reply函数。

6、代码确认无误后,点击pycharm页面右上角的tkinter_t.py文件名旁边的绿色三角按钮,开始运行代码。

7、刚创建的窗口是个很小的窗口,只显示了一个按钮的高度。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6213468.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-18
下一篇 2023-03-18

发表评论

登录后才能评论

评论列表(0条)

保存