<!DOCTYPE html> <html> <head> <meta charset=UTF-8"> </head> <body> <form action="./index.php" method="get"> 用户名:<input type="text" name="username"/> 密码 :<input type="password" name="password"/> <input type="submit" value="提交"/> </form> </body> </html>
这是HTML码.
------------------------------------------------------
<?php
$user='admin';
$pass='111111';
$userName = $_GET['username'];
$passWord = $_GET['password'];
if($userName == " || $passWord == "){
echo '用户名或密码不能为空';
}
?>
这是PHP. 在HTML页面点击提交 为什么不显示 '用户名或密码不能为空'.
求大神帮忙看下 谢谢.
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
if($userName == " || $passWord == "){ 引号的问题,你这个是双引号,而且只有一半