【发布时间】:2016-03-02 00:39:58
【问题描述】:
这是一个视图(一个状态的templateUrl),由于某种原因,isset 可以正常工作。我在代码的底部通过传入 if(isset($_POST["submit"])){do这个} 。但它并没有这样做。我清楚地给了它一个“提交”的名称属性和一个“提交”的类型属性。请帮忙谢谢:
<?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>
【问题讨论】:
-
空格是怎么回事?
<form method = "post"> -
那没有帮助。更新@samayo 上面的代码
-
是的,但遗憾的是,这对按钮没有帮助@RiggsFolly :(但感谢您指出这一点
-
你有 2 个按钮?你确定你按对了吗???
-
什么是
<md-whiteframe>它不是我认识的 HTML 标签
标签: javascript php html angularjs