很多站长朋友们都不太清楚php如何判断简单密码,今天小编就来给大家整理php如何判断简单密码,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 PHP用户名密码怎么判断啊,要连接数据库QAQ 2、 PHP怎么判断两次密码是否正确 3、 PHP 在用户登录后提示密码过于简单 4、 php网页的密码验证绕过求助(简单代码) 5、 php 帐号密码判断简单问题 PHP用户名密码怎么判断啊,要连接数据库QAQ使用sqlite数据库实现网页登录
客户端网页 login.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>微博入口</title>
<style type="text/css">
.tit {
font-size: 36px;
color: #06C;
font-style: normal;
text-align: center;
}
.lab {
font-size: 16px;
color: #069;
}
.hin {
width:98%;
size:3;
color:#33FF66;
}
</style>
<script language="javascript" >
function checkfrm()
{
if(document.getElementById("txtuser").value=="")
{
window.alert("用户名不能为空!");
return false;
}
if(document.getElementById("txtpwd").value=="")
{
window.alert("密码不能为空!");
return false;
}
document.getElementById("frm1").action="funcexec.php";
//return true;
}
</script>
</head>
<body>
<form id="frm1" name="frm1" target="_self" method="post">
<div>
<p class="tit">微博入口</p>
</div>
<hr class="hin"/>
<div>
<table width="309" border="0" >
<tr>
<td width="100" height="20" align="right" class="lab" >用户名:</td>
<td width="90" align="left"><label for="textfield"></label>
<input name="txtuser" type="text" class="lab" id="txtuser" /></td>
</tr>
<tr>
<td align="right" class="lab" >密nbsp;nbsp;nbsp;码:</td>
<td align="left"><input name="txtpwd" type="password" class="lab" id="txtpwd" /></td>
</tr>
<tr class="content">
<td colspan="2" align="center"><input type="submit" name="btn" id="btn" value="提交" onClick="checkfrm()"/></td>
</tr>
</table></div>
</form>
</body>
</html>
php程序判断 func.php
<?php
session_start();
$conn=new PDO("sqlite:pic/maindata.db");
$login_sth=$conn->prepare("select count(*) as t from usertab where uid=? and pwd=?");
$article_sth=$conn->prepare("select * from ArticleList");
if(isset($_POST["btn"]))
{
$uid=$_POST["txtuser"];
$pwd=$_POST["txtpwd"];
$login_sth->execute(array($uid,$pwd));
$tot=$login_sth->fetchAll();
if($tot[0][0]>0)
{
$_SESSION["userid"]=$uid;
echo("欢迎您,$uid");
echo("<a href='index.php'>点击进入主页</a>");
}
else
echo("登陆失败");
}
else
{
echo("非法操作");
}
?>
PHP怎么判断两次密码是否正确先根据UserId从数据库查出对应的密码
if(旧的密码==原来userid在数据库中留存的密码){
新的密码保存语句,一般是update
}else{
return 旧密码不正确
}
PHP 在用户登录后提示密码过于简单正则表达式就可以
判断字母后面是否有数字,或者数字后面是否有字母
$a = 'lkj12lkkj';
$match = '/^([a-z]+(?=[0-9])|[0-9]+(?=[a-z]))[a-z0-9]+$/i';
if(preg_match($match,$a)){
echo '可以注册';
}else{
echo '密码太过简单';
}
php网页的密码验证绕过求助(简单代码)初步判断,密码为yixiwangmengsicengjian
原理
if($LoginPassword!=''){ 表示$LoginPassword不能为空
而$LoginPassword 的值来自于$LoginPassword=$UserList[$LoginUser];
而$UserList这个数组只有一个元素, admin
那$UserList[$LoginUser] 只能是$UserList['admin'];
而很明显$UserList['admin'] 的值就是 yixiwangmengsicengjian
表单方面, 一个输入框, 一个密码框, 输入框的name属性是User 密码框的name属性是 Password
php 帐号密码判断简单问题肯定是一直显示失败 因为你的if语句是错误的$_POST['username1']==$user1 and $_POST['password1']==$pass $user1 和$pass是没有的
关于php如何判断简单密码的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。
查看更多关于php如何判断简单密码 php判断密码长度的详细内容...