php register form help

Please help i can’t get it to work when i click submit nothing no error messeges other then some notices and it won’t come up in my db
[php]<?php

if(isset($_POST[‘submit’])) {

//Perform the verification of the nation
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
$email1 = $_POST['email1'];
$email2 = $_POST['email2'];

if($email1 == $email2) {
	if($pass1 == $pass2) {
		//All good. Carry on.
		$fname = $_POST['fname'];
		$lname = $_POST['lname'];
		$uname = $_POST['uname'];
		$pass1 = ($pass1);
		$pass2 = ($pass2);
		$email1 = ($email1);
		$email2 = ($email2);

		mysql_connect('localhost','root','') or die("Counldn't connect to mysql");
		mysql_select_db('php_login') or die ("Couldn't find database");
				
		mysql_query("INSERT INTO 'users' ('id', 'first name', 'last name', 'username', 'password', 'email') VALUES (NULL, '$fname' '$lname', '$uname', '$pass1', '$email1'");
			
	} else {
		echo "Your passwords do not match";
	}
} else {
		echo "Your emails do not match";
}

}

$form = <<<EOT

First Name

Last Name

Username

Password

Confirm Password

Email

Confirm Email

EOT;

echo $form;
?>[/php]

change the query too
[php] mysql_query(“INSERT INTO ‘users’ (‘id’, ‘first name’, ‘last name’, ‘username’, ‘password’, ‘email’) VALUES (’’, ‘$fname’ ‘$lname’, ‘$uname’, ‘$pass1’, ‘$email1’”) or die(mysql_error());[/php]
and change the second group of inputs to
[php]$fname = mysql_string_real_escape($_POST[‘fname’]);
$lname = mysql_string_real_escape($_POST[‘lname’]);
$uname = mysql_string_real_escape($_POST[‘uname’]);
$pass1 = mysql_string_real_escape($pass1);
$pass2 = mysql_string_real_escape($pass2);
$email1 = mysql_string_real_escape($email1);
$email2 = mysql_string_real_escape($email2);
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service