sytodave88
New Member
i need some one who can but in a codeing in to my register script where it send the user a email and the user has to click the link to confrim it
here is the register code
here is the register code
PHP:
<?
// Register Process, register.php
// Includes the Constants
include("cons.php");
// sets all the variables needed to register
$pass = $_GET['pass']; // set $pass as the first pass
$pass2 = $_GET['pass2']; // sets $pass2 as the re-entered pass
$name = $_GET['name']; // sets $name as the name chosen
$email=$_GET['email'];
$country=$_GET['country'];
$gender=$_GET['gender'];
// Processing the data
if (strlen($name) >= 15) {
$error = "* Username too long, Max is 15 characters";
$err = 1;
}
if (strlen($name) <= 3) {
$error = "* Username too short, Min is 4 characters";
$err = 1;
}
if ($name) { // if $name is set
$re = mysql_num_rows(mysql_query("SELECT * FROM user WHERE user='$name'"));
if ($re >= 1) { // If the username exists
$error = "* Username already in use"; // Set $error
$err = 1; // set $err as 1
}
else { // user doesn't exist
if ($pass == $pass2) { // If the passwords match
$pass = md5($pass); // Encodes the pass
if (eregi('[<>]',$name)) {
$error = "* No HTML allowed"; // No HTML in name
$err = 1;
}
else {
if (!$err) { // If there are no errors
if (mysql_num_rows(mysql_query("SELECT * FROM user")) == 0) {
mysql_query("INSERT INTO user (user, pass, userlevel) VALUES ('$name','$pass', '9')"); // Creates the Admin
}
else {
mysql_query("INSERT INTO user (user, pass, userlevel,email) VALUES ('$name','$pass', '1','$email')"); // Creates the user
mysql_query("INSERT INTO online_status (username) VALUES ('$name')");
mysql_query("INSERT INTO crimes (username) VALUES ('$name')");
mysql_query("INSERT INTO gtas (username) VALUES ('$name')");
mysql_query("INSERT INTO bj_games (username) VALUES ('$name')");
mysql_query("INSERT INTO profiles (username) VALUES ('$name')");
mysql_query("INSERT INTO user_stats (username, country, gender) VALUES ('$name', '$country', '$gender')");
}
$reg = "Registration successful!"; // Sets $reg as a sucess message
header("Location: login.php?reg=$reg"); // Re-locates to the login screen
}
}
}
else { // The passwords don't match
$error = "* Passwords different!"; // Sets $error
$err = 2; // Sets $err as 2
}
}
}
else { // If $name isn't set
$error = "* Enter a username"; // sets $error
$err = 1; // sets $err as 1
}
if ($err >= 1) { // if $err is greater than or equal to 1
header("Location: reg.php?error=$error&err=$err"); // re-locates to the registration page with the error!
}
?>