本文介绍了Php方法=" post"没有在表单操作上执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有html表格的php文件
i have a php file that has a html form
<form action="CustomerLoginHTML.php" method="POST">一旦按钮点击甚至执行表格就应该执行里面的php文件。 但不执行php部分,但是为什么呢? 我尝试过的事情:
once the button click even perform the form should execute the php file inside it. but it dose not execute the php part, but why? What I have tried:
<!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Sign in</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="CSS/SSLoginGen.css"> </head> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (isset($_POST['login'])) { //user logging in require 'Custlogin_Dbchk.php'; } else{ $message = "wait for it"; echo "<script type='text/javascript'>alert('$message');</script>"; } } ?> <body> <form action="CustomerLoginHTML.php" method="POST"> <center> <div class="loginbox"> <h1>Customer Login</h1> <input type="username" name="username" id="username" placeholder="Username" required/><br><br> <input type="password" name="password" id="password" placeholder="Password" required/><br><br> <input type="button" value="LOGIN" name="login"/><br><br> <a href="ResetPW.php" style="color:whitesmoke">Forgot your Password?</a><br><br> <a href="index.php"><input type="button" value="BACK TO HOME" id="home"/></a> </div> </center> </form> </body> </html>推荐答案
_SERVER ['REQUEST_METHOD'] =='POST') { if(isset( _SERVER['REQUEST_METHOD'] == 'POST') { if (isset(
_POST ['login'])){//登录 的用户需要'Custlogin_Dbchk.php'; } else { _POST['login'])) { //user logging in require 'Custlogin_Dbchk.php'; } else{
message =等待它; echo< script type ='text / javascript'> alert(' message = "wait for it"; echo "<script type='text/javascript'>alert('
更多推荐
Php方法=" post"没有在表单操作上执行
发布评论