我正在为我的网站进行注册,已经创建了数据库并编写了html和php代码,但是我一直收到以下错误:“解析错误:语法错误,D:\ XAMPP中出现意外的'}' \ htdocs \ example \ boosie.php行73”。如果删除它,我的文件将无法在我的浏览器上运行,只会继续加载。不知道还有什么问题,有什么可以帮到我!
<?php
$mysqli = new mysqli("127.0.0.1:3307", "root", "", "boosie");
if (mysqli_connect_error()) { echo mysqli_connect_error(); exit; }
// The (?,?,?) below are parameter markers used for variable binding
if(isset($_POST['submit'])){
$sql = "INSERT INTO Signup (First_Name, Last_Name, Email, Password, Re_Password) VALUES (?,?,?,?,?)";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param("sssss", $First_Name, $Last_Name, $Email, $Password, $Re_Password); // bind variables
$First_Name = $_POST['First_Name'];
$Last_Name = $_POST['Last_Name'];
$Email = $_POST['Email'];
$Password = $_POST['Password'];
$Re_Password = $_POST['Re_Password'];
$result=$stmt->execute(); // execute the prepared statement
echo "New records created successfully ";
$stmt->close(); // close the prepared statement
$mysqli->close(); // close the database connection
}else
?>
{
<html>
<head>
<title> Signup Form Design Tutorial </title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="login-box">
<div class="left-box">
<h1> Sign Up</h1>
<form method="post" action="boosie.php">
<input type="text" name="First_Name" placeholder="First_Name"/>
<input type="text" name="Last_Name" placeholder="Last_Name"/>
<input type="email" name="Email" placeholder="Email"/>
<input type="password" name="Password" placeholder="Password"/>
<input type="password" name="Re_Password" placeholder="Retype Password"/>
<input type="submit" name="signup-button" value="Sign Up"/>
</form>
</div>
<div class="right-box">
<span class="signinwith">Sign in with<br/>Social Network </span>
<button class="social facebook">Log in with Facebook</button>
<button class="social twitter">Log in with Twitter</button>
<button class="social google">Log in with Google+</button>
</div>
<div class="or">OR</div>
</div>
</body>
</html>
<?php
}
?>
答案 0 :(得分:0)
您的左括号位于PHP标记之外。
这里:
}else
?>
{
做到这一点:
}else{
?>