Home > Backend Development > PHP Tutorial > 关于php中isset的问题

关于php中isset的问题

WBOY
Release: 2016-06-20 12:32:56
Original
1076 people have browsed it

if ( isset($_POST['pass']) & isset($_POST['name']) & @MD5($_POST['pass'])==" admin" & @$_POST['name']==" admin" )

这一句中为什么我在前端输入用户名admin跟密码admin时始终进不去呢?


if ( isset($_POST['pass']) & isset($_POST['name']) & @MD5($_POST['pass'])==" admin" & @$_POST['name']==" admin" )
{
?>





}else{
?>












}  
?> 


回复讨论(解决方案)

MD5($_POST['pass'])=="admin" 
这是永远都不会成立的
md5 对任何值(包括空串)都返回一个长度为 32 字节的串

一个&是位运算
两个&&才是并且关系

还有任何md5的值都是32位的字符串

应该怎样修改呢

if ( isset($_POST['pass']) && isset($_POST['name']) && $_POST['pass']=="admin" && $_POST['name']=="admin" )

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template