Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(array_key_exists('firstname', $_POST) && array_key_exists('lastname', $_POST) && array_key_exists('email', $_POST) ) {
- $db = mysqli_connect("localhost","","","") or die ("Connection failed!");
- $query = ('INSERT INTO 'Users' (firstname, lastname, email, pass, cpass) VALUES (?, ?, ?, ?, ?)');
- $stmt = $db->prepare($query);
- $stmt->bind_param("sssss", $_POST['firstname'], $_POST['lastname'], $_POST['email'], $_POST['pass'], $_POST['cpass']);
- if ($stmt->execute()) {
- 'Yay!! New user was added.'
- } else {
- die('Oops we could not add your deatils to the user database.');
- }
- $db->close();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment