Simple php sigh up form

Hi,

I am having trouble with a simple sign up form. I have the form code which is fine and here is the code for the process once the user has enetered the data into the form.

    $username = $_POST['liusername'];
    $password = $_POST['lipassword'];
    $emailAddress = $_POST['liemail'];
    $firstName = $_POST['lifirstname'];
    $surname = $_POST['lisurname'];
$DOB = $_POST['lidob'];
    $city = $_POST['licity'];
    $sports = $_POST['lisports'];

    $query = "INSERT INTO `user` 
	(user_username, user_password, user_email, user_firstname, user_surname, user_dob, user_city) 
	
	VALUES ('$username', '$password', '$email', '$firstName', '$surname', '$DOB', '$city')";
    
	
	
		$result = mysql_query($query);
                    if($result) {
        echo "User Created Successfully.";

Any ideas where im going wrong?

Thanks!!

Post all of the code. You are missing some import parts.

Well, I see one issue. You have a misspelled variable in your query.

$query = “INSERT INTO user (user_username, user_password, user_email, user_firstname, user_surname, user_dob, user_city) VALUES (’$username’, ‘$password’, ‘$email’, ‘$firstName’, ‘$surname’, ‘$DOB’, ‘$city’)”;

$email should be $emailAddress since that’s what you defined $_POST[‘liemail’] as.

Sponsor our Newsletter | Privacy Policy | Terms of Service