更新后wamp php 5.6 php插入不工作...我做错了什么? 在更新之前,相同的代码工作正常。
<form action="signup.php" method="POST">
<input class="insert" name="firstname" required id="firstname-signup" type="text" value="" placeholder="First name"><br><br>
<input class="insert" name="lastname" required id="lastname-signup" type="text" value="" placeholder="Last neme"><br><br>
<input class="insert" name="email" required id="email-signup" type="text" value="" placeholder="Email"><br><br>
<input class="insert" name="password" id="password-signup" type="text" value="" placeholder="Password"><br><br>
<input class="submit" name="submit" id="button-signup" type="submit" value="Signup">
</form>
<?php
if (isset($_POST['submit'])){
session_start();
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$password = $_POST['password'];
$sql = "INSERT into user ( firstname, lastname, email, password ) VALUES ('$firstname','$lastname', '$email', '$password' )";
$result = mysqli_query($con,$sql);
header('location: login.php');
}
?>