Home > Backend Development > PHP Tutorial > 判断$_post的值,该如何解决

判断$_post的值,该如何解决

WBOY
Release: 2016-06-13 12:22:50
Original
1073 people have browsed it

判断$_post的值
1.$_post的值如何判断?

if(isset($_POST["username"])=""){echo"kong";}elseif(isset($_POST["username"])!="admin"){echo"kong";}
Copy after login


上面的写法对吗?
------解决思路----------------------
if(isset($_POST["username"]) && $_POST["username"] == '') {<br />  echo"kong";<br />}elseif(isset($_POST["username"]) && $_POST["username"] != "admin") {<br />  echo"kong";<br />}
Copy after login

------解决思路----------------------
<br />if (isset($_POST['username']) && (empty($_POST['username']) <br><font color='#FF8000'>------解决思路----------------------</font><br> $_POST['username'] !== 'admin')) {<br />    echo 'kong';//空或不等于admin<br />} elseif (isset($_POST['username']) && $_POST["username"] == 'admin') {<br />    echo "yes";//管理员<br />}<br /><br />
Copy after login

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