我寫一個基本的PHP登錄/註冊腳本,出於某種原因,當我加入PHP命令未加載HTML加載。我看了一下源代碼,但沒有任何裝載。我希望我錯過了一些非常基本的東西,但是我也遇到了一些與Web服務器上安裝的PHP版本有關的問題。HTML沒有在PHP文件
<?php
require_once('connect.php');
if(isset($_POST) & !empty($_POST)){
$username = mysql_real_escape_string($_POST['username']);
$email = mysql_real_escape_string($_POST['email']);
$password =md5($_POST['password']);
$sql = "INSERT INTO 'login' (username, email, password) VALUES ('$username, $email, $password)";
$result = mysql_query($connection, $sql);
if($result){
echo "User Rego Secusseflllgk";
}else{
echo "User rego faile";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>USer Reg in PHP & MySQL</title>
</head>
<center>
<body>
<div class="container">
<form class="form-signin" method="POST">
<h2 class="form-sigin-heading">Please register</h2>
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">@</span>
<input type="test" name="username" class="form-control" placeholder="Username" required>
</div>
<label for="inputEmail" class="sr-only">Password</label>
<input type="email" name="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" name="password" id="inputPassword" class="form-control" placeholder="Password" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
<a class="btn btn-lg btn-primary btn-block" href="login.php">Login</a>
</form>
</div>
</body>
</html>
我試圖打印POST請求,但這個didnt棚對這個問題的光
print_r($_POST);
是否使用類似的Apache2 web服務? – Troyer