Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['subs'])) {
- include 'connection.php';
- $flname = $_POST['flname'];
- $gender = $_POST['gender'];
- $user = $_POST['user'];
- $pass = $_POST['pass'];
- $cpass = $_POST['cpass'];
- $hruser = $_POST['hruser'];
- $usercheck = mysqli_query($conn,"SELECT * from users where username = '$user'");
- if($usercheck == $_POST['user'] ) {
- header("location:admin.php?userun");
- }
- else{
- if ($_POST['pass'] != $_POST['cpass']) {
- header("location:admin.php?error");
- }
- else {
- $insertData = "INSERT INTO `users`(`username`,`password`,`nameofuser`,`usertype`,`gender`) VALUES ('$user','$pass','$flname','$hruser','$gender')";
- if ($conn->query($insertData) === TRUE) {
- header("location:admin.php?success");
- }else{
- echo "Error: " . $insertData . "<br>" . $conn->error;
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement