Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //connection
- include("connection.php");
- //prepare statement
- $sql = "insert into users(username,email,password) values(?,?,?)";
- $stmt = $conn->prepare($sql);
- //bind parameters
- $stmt->bind_param("sss", $username, $email, $password);
- //set parameters
- $username=$_POST["username"];
- $email=$_POST["email"];
- $password=$_POST["password"];
- //execute
- $stmt->execute();
- echo "new user added successfully";
- //redirect
- header("Location: index.html");
- //close stmt connection
- $stmt->close();
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement