My data is printing fine on the page but the data which we are inserting is not saved in the database
<?php include "config.php"; if(isset($_POST['submit'])) { $name=$_POST['name']; $username=$_POST['username']; $password=$_POST['password']; $confirmpassword=$_POST['confirmpassword']; $email=$_POST['email']; $sql="INSERT INTO register( name, username, password, confirmpassword, email) VALUES ('$name','$username','$password','$confirmpassword','$email')"; if(mysqli_query($conn,$sql)) { ?> <script type="text/javascript"> alert("data is saved succesfully"); </script> <?php } else{ ?> <script type="text/javascript"> alert("data is not saved succesfully"); </script> <?php } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title></title> </head> <body> <form action="signup.php" method="POST"> <h1>Registration Page</h1> Name:<input type="text" name="name" placeholder="Enter your name" required><br> Username:<input type="text" name="username" placeholder="Enter your username" required><br> Password:<input type="password" name="password" placeholder="Enter your password" required><br> ConfirmPassword:<input type="password" name="confirmpassword" placeholder="Enter your confirmpassword" required><br> Email:<input type="text" name="email" placeholder="Enter your Email" required><br> <input type="submit" name="submit" value="Register"> <p> Already a member? <a href="login.php">Sign in</a> </p> </form> </body> </html>
$conn
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)