[AngularJS]设定不工作提交按钮

发布时间: 2017/4/16 19:33:11
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.

这是一种观点 (templateUrl 的一个国家),并设定为一些原因不能正常工作。我通过在 if(isset($_POST["submit"])) 代码底部 {做这}。但它这样做之外。我显然给了它一个 name 属性的"提交"和"提交"类型属性。请帮助谢谢︰

    <?php
var_dump($_GET);
require_once('PhpConsole.phar');
require_once('connection.php');
  ?>
<!DOCTYPE html>
<html lang="en-US">
<head>
</head>

<body>

    <div id="page">

    <h1>Registration </h1>
    <form  method = "post">
          <input  type = "text" name = "username" placeholder = "Username"required/>
          <br>
          <input  type = "text"name = "email" placeholder = "Email"required/>
          <br>
          <input type = "text" placeholder = "password" name = "password" required/>
          <br>
          <input type = "submit" name = "submit"/>
    </form>
    </div>
<?php
$username = $_POST["username"];
$email = $_POST["email"];
$password = $_POST["password"];
if(isset($_POST["submit"])){

  $query = "INSERT INTO authe (authe.Email , authe.Password, authe.Username) VALUES ('".$email."', '".$password."' , '".$username."')";
  if($result = $connection->query($query))
  {
  header("Location: http://localhost:8012/phpForm/login.php");
  }
  else{
    echo "Something Went wrong...";
  }
}
 ?>

</body>
  </html>

解决方法 1:

在测试中,这普通的 PHP 代码工作,

<!DOCTYPE html>
<html lang="en-US">
    <head>
    </head>
    <body>
        <div id="page">
            <h1>
                Registration 
            </h1>
            <form  method = "post">
                <input  type = "text" name = "username" placeholder = "Username"required/>
                <br>
                <input  type = "text"name = "email" placeholder = "Email"required/>
                <br>
                <input type = "text" placeholder = "password" name = "password" required/>
                <br>
                <input type = "submit" name = "submit"/>
            </form>
        </div>
        <?php
            print_r($_POST); 
            if(isset($_POST["username"])){
                $username = $_POST["username"];
            }
            if(isset($_POST["email"])){
                $email = $_POST["email"];
            }
            if(isset($_POST["password"])){
                $password = $_POST["password"];
            }
            if(isset($_POST["submit"])){
                    echo $username .PHP_EOL;
                    echo $email .PHP_EOL;
                    echo $password .PHP_EOL;
            }
        ?>
    </body>
</html>

现在按照别人的要求请邮编非工作与角的组件来进一步帮助。

官方微信
官方QQ群
31647020