Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //connect to database
- $db = mysqli_connect('localhost', 'root', '', 'ticketing');
- if (isset($_POST['submit']))
- {
- session_start();
- $username = ($_POST['username']);
- $email = ($_POST['email']);
- $password =($_POST['password']);
- $re_type = ($_POST['re_type']);
- if ($password == $re_type)
- {
- //create user
- $sql = "INSERT INTO registration VALUES ('$_POST[username]','$_POST[email]','$_POST[password]','$_POST[re_type]')";
- mysqli_query($db, $sql);
- $_SESSION['message'] = "You are now logged in";
- $_SESSION['username'] = $username;
- $_SESSION['email'] = $email;
- $_SESSION['password'] = $password;
- $_SESSION['re_type'] = $re_type;
- header("location:waley.php"); //redirect to homepage
- }
- else
- {
- $_SESSION['message'] = "The two passwords do not match";
- }
- }
- ?>
Add Comment
Please, Sign In to add comment