if(isset($_POST['regSubmit'])) {
//get your post variables
$a=$_POST['user'];
$b=$_POST['email'];
$c=$_POST['passwrd1'];
$d=$_POST['passwrd2'];
//verify the password if the same
if($c != $d) { die('password mismatch'); };
//encrypt your password
$e = md5($c);
//Connect to your database
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mydb");
//make sure you have the same column number in inserting values
$result = mysql_query("INSERT INTO USER VALUES('$a', '$c', '$b'");
if(!$result) $_SESSION['success'] = '1';
mysql_close($conn);
}
if($_SESSION['success'] == '1') {
echo "Failed!";
//or HTML put here
} else {
//or HTML put here
echo "Success!";
}
Quote ...
NOTE: read addslashes, stripslashes and !get_magic_quotes_gpc if you want to use them.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Previous Thread in Graphics and Multimedia Forum Timeline:Two tone background