PHP Code:
<?php
session_start();
include_once"connect.php";
if (isset($_SESSION['username'])){
header("Location: login_success.php");
exit();
}
if ($_POST['submit']){
// Define post fields into simple variables
$reg_username = $_POST['username'];
$email = $_POST['email'];
$email1 = $_POST['email1'];
$location=strip_tags($_POST['location']);
$reg_username=trim($reg_username);
$today = gmdate('Y-m-d h:i:s');
$reg_username = stripslashes($reg_username);
$email = stripslashes($email);
$quote = stripslashes($quote);
$reg_username = strip_tags($reg_username);
$email = strip_tags($email);
if((!$reg_username) || (!$email) || (!$location)){
echo "Please fill in all fields!";
include 'register5.php';
exit();
}else{
if ($email != $email1){
echo "Emails dont match!";
include 'register5.php';
exit();
}elseif ($email == $email1){
if (ereg('[^A-Za-z]', $reg_username)) {
echo "Username can only contain letters!";
include 'register5.php';
exit();
}elseif (!ereg('[^A-Za-z]', $reg_username)) {
if (strlen($reg_username) <= 3 || strlen($reg_username) >= 40){
echo "The username is to big or to small!";
include 'register5.php';
exit();
}elseif (strlen($reg_username) > 3 || strlen($reg_username) < 40){
$sql_email_check = mysql_query("SELECT email FROM users
WHERE email='$email' AND status='Alive'");
$sql_username_check = mysql_query("SELECT username FROM users
WHERE username='$reg_username'");
$email_check = mysql_num_rows($sql_email_check);
$username_check = mysql_num_rows($sql_username_check);
if(($email_check > 0) || ($username_check > 0)){
echo "Im sorry but there has been an error please read on..<br />";
if($email_check > 0){
echo "That email is already being used!";
include 'register5.php';
exit();
unset($email);
}
if($username_check > 0){
echo "Your desired username is already in use!";
include 'register5.php';
exit();
unset($reg_username);
}
$ip = $_SERVER['REMOTE_ADDR'];
$random_password22=rand(11111,99999999);
mysql_query("INSERT INTO `user_info` ( `id` , `username`)
VALUES (
'', '$reg_username')");
mysql_query("INSERT INTO `users` ( `id` , `username` , `password` , `activated` , `money` , `online` , `crimechance` , `lastcrime` , `rankpoints` , `userlevel` , `lasttop` , `status` , `regged` , `rank` , `layout` , `email` , `quote` , `image` , `location` , `bullets` , `gtachance` , `lastgta` , `lasttravel` , `bank` , `banktime` , `last_race` , `music` , `crew` , `get_away_time` , `get_away` , `health` , `energy` , `last_ext` , `lasttran` , `drugprices` , `drugs` , `l_ip` , `r_ip` , `crew_invite` , `referral` , `weapon` , `mission` , `points` , `lpv` , `page` , `editor` , `food_chance` , `last_food` , `last_order` , `freinds` , `protection` , `plane` , `married` , `oc` , `last_oc` , `atm` , `last_bank` , `last_attempted` , `last_kill` , `ver_code` , `last_script_check` , `global` , `poll` , `clicks` , `click_rate` , `tut` , `drugs_from` , `total_drugs_mission` )
VALUES (
'', '$reg_username', '$random_password22', '1', '10000', '', '0-0-0-0-0-0-0', '', '0', '0', '', 'Alive', '$today', 'Scum', '0', '$email', 'No quote', 'images/default.jpg', '$location', '0', '0-0-0', '', '', '0', '', '', '', '0', '', '0', '100', '100', '', '', '0-0-0-0-0', '0-0-0-0-0', '127.0.0.1', '$ip', '0', '0', 'None', '1', '0', '', '', '0', '0-0-0', '', '', 'None', 'None', 'None', '', '0', '', 'False', '', '', '', '456', '', '0', '', '0', '', '0', '', '0' )");
$userid = mysql_insert_id();
// Let's mail the user!
$subject = "Tactical Mafia Account!";
$message = "Dear $reg_username,
Hello $reg_username , Welcome To Tactical Mafia. Thank You for Registering. Below you will find the Information in which to login.
Please enter this information at the login screen in order to play Tactical Mafia. You can change your password on the game.
Login with the following information:
Username: $reg_username
Password: $random_password22
Thanks!
Tactical Mafia Staff.
This is an automated response, please do not reply!";
mail($email, $subject, $message,
"From: Tactical Mafia<support@tacticalmafia.com>");
echo "Your account has been registered! Check your email for your info!";
} }}}}}
?>
Bookmarks