Jump to content

IllusiveBroker

New Members
  • Posts

    2
  • Joined

  • Last visited

IllusiveBroker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've put var_dump($result) after the $result= mysqli_query($conn, $sql) line but nothings coming up. and there is no data being inserted! That's another issue, it won't even input any of the data I'm putting into the fields!
  2. <?php error_reporting(E_ALL); ini_set('display_errors', 1); session_start(); require_once 'ConnectorCode.php'; if(isset($_POST['submit'])) { $FName = mysqli_real_escape_string($conn, $_POST['First_Name']); $LName = mysqli_real_escape_string($conn, $_POST['Last_Name']); $Email = mysqli_real_escape_string($conn, $_POST['Email']); $UName = mysqli_real_escape_string($conn, $_POST['User_Name']); $Password = mysqli_real_escape_string($conn, $_POST['Password']); $sql = "SELECT * FROM tbl_Users WHERE Email='$Email'"; $result = mysqli_query($conn, $sql); if(count($result) == 0) { $insert_sql = "INSERT INTO tbl_Users (First_Name,Last_Name,Email,User_Name,Password) VALUES ('$FName','$LName','$Email','$UName','$Password')"; if(mysqli_query($conn, $insert_sql)) { echo "Thank you for registering"; header('Location: index.php'); exit; } } else { echo "Sorry, that email already exists!"; } mysqli_close($conn); } ?> Long story short. I'm trying to set up a registration form for users to use to create an account in which will then send the information they enter into my html form into my Users table on my MySQL database. I have everything set up properly but all I seem to get now is the else echo message which is: else { echo "Sorry, that email already exists!"; } It always pops up whenever submit is clicked! I don't know why! Why is it doing this I'm so close to having this file finished! Register.php
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.