listysite76
New Member
- Messages
- 28
- Reaction score
- 0
- Points
- 0
my website URL=lislia.com
please help to correct error's of my sighn up form
blow is register.php
please help to correct error's of my sighn up form
blow is register.php
PHP:
include 'config.php';
$firstname = $_POST['name'];
$lastname = $_POST['name'];
$email = $_POST['email'];
$password =($_POST['password']);
// username already exists
$checkuser = mysql_query("SELECT email FROM users WHERE email='$email'");
$username_exist = mysql_num_rows($checkuser);
if($username_exist > 0){
echo "I'm sorry but the e-mail you specified has already been taken. ";
unset($email);
include 'index.html';
exit();
}
// lf no errors present with the username
// use a query to insert the data into the database.
$query = "INSERT INTO users (firstname,lastname, email, password)
VALUES('$firstname', '$lastname','$email','$password')";
mysql_query($query) or die(mysql_error());
mysql_close();
echo "You have successfully Registered";
// mail user their information
$yoursite = ‘www.blahblah.com’;
$webmaster = ‘yourname’;
$youremail = ‘youremail’;
$subject = "You have successfully registered at $yoursite...";
$message = "Dear $name, you are now registered at our web site.
To login, simply go to our web page and enter in the following details in the login form:
e-mail: $email
Password: $password
Please print this information out and store it for future reference.
Thanks,
$webmaster";
mail($email, $subject, $message, "From: $yoursite <$youremail>\nX-Mailer:PHP/" . phpversion());
echo "Your information has been mailed to your email address.";