前辈们帮我看一下下面的代码错在哪里 phphtml 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 echo "<scipt>alert('用户名或者密码不能为空');</scipt>";写错了应该是<script></script> 你不是 post 方式提交的,自然不能通过 $_POST 验证 你没写method =post,那么默认就是get方式提交的。 1.form沒有加method="post"2.<input type="submit" value="登录" name="Sumbit"/> 應該是 <input type="submit" value="登录" name="Submit"/>3.echo "<scipt>alert('用户名或者密码不能为空');</scipt>"; 應該是 echo "<script>alert('用户名或者密码不能为空');</script>";改成這樣就可以了<html><head><title>用户名或者密码不能为空</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><form action="" method="post">用户名:<input type="text" name="user"/></br>密码:<input type="password" name="pass"/></br><input type="submit" value="登录" name="Submit"/></br><input type="reset" value="取消"/></form></body></html><?php if(isset($_POST['Submit'])&&$_POST['Submit']=="登录"){ $user=$_POST['user']; $pass=$_POST['pass']; if(empty($user)||empty($pass)){ echo "<script>alert('用户名或者密码不能为空');</script>"; }}?> 发帖求助,XAMPP添加redis扩展的问题 用move_uploaded_file()上传文件出错 送域名+送网页空间+送企业邮局/送SQL数据库 内容分页代码 急!急! 一个关健字关联的调用,。 问关于?的正则表达式 CGI程序的运行权限 网页上执行一个php,然后关闭页面,能否让该后台程序还是能运行,每个5秒发封邮件 如何在php中让页面自动跳转到另一个页面。 请教用PHP设计文件上传系统时遇到的问题 php mysql php抓取这个页面的内容
2.<input type="submit" value="登录" name="Sumbit"/> 應該是 <input type="submit" value="登录" name="Submit"/>
3.echo "<scipt>alert('用户名或者密码不能为空');</scipt>"; 應該是 echo "<script>alert('用户名或者密码不能为空');</script>";改成這樣就可以了
<html>
<head>
<title>用户名或者密码不能为空</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<form action="" method="post">
用户名:<input type="text" name="user"/></br>
密码:<input type="password" name="pass"/></br>
<input type="submit" value="登录" name="Submit"/></br>
<input type="reset" value="取消"/>
</form>
</body>
</html>
<?php
if(isset($_POST['Submit'])&&$_POST['Submit']=="登录"){
$user=$_POST['user'];
$pass=$_POST['pass'];
if(empty($user)||empty($pass)){
echo "<script>alert('用户名或者密码不能为空');</script>";
}
}
?>