Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- // This usersystem has been created for the use of ShareHabbo.NET
- // This system has been created by Alfredo Morales
- // All of it's content is copyrighted to Alfredo Morales
- // Any reproduction of this system without the permission of Alfredo Morales is not allowed
- // For more information contact Alfredo at brentanoalfredo@yahoo.com
- session_start();
- include("inc/config.php");
- if(isset($_SESSION['username'])){
- header("Location: index.php");
- die();
- }
- echo("<link href=\"../css/register.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />");
- ?>
- <?
- if(!isset($_POST[submit])){
- ?>
- <strong>Register at <? echo("$sitename"); ?></strong><br/>
- <p>Welcome to the registration form! This is where you enter the specified details in order to create your instantly activated <? echo("$sitename"); ?> account where you can sign in and manage uploads, view and edit your profile as well as message other users and much more!</p>
- <p>Please enter the following details:</p>
- <?
- include("func.reg.php");
- registration();
- }else{
- include("func.reg.php");
- // Change the POST's into variables
- $username = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['username'])));
- $password = md5($_POST['password']);
- $password2 = md5($_POST['passwordc']);
- $rpass = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['password'])));
- $email = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['email'])));
- $name = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['name'])));
- $age = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['age'])));
- $birthday = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['birthday'])));
- $habboname = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['habboname'])));
- $habbohotel = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['habbohotel'])));
- $terms = $_POST['terms'];
- // Check to make sure the info is valid
- $ip = $_SERVER['REMOTE_ADDR'];
- $getip = mysql_query("SELECT * FROM `users` WHERE `ip` = '$ip'");
- $checkip = mysql_num_rows($getip);
- if(!$checkip){
- echo("Unfortunately you already have an account!");
- }elseif(!$username || !password || !$password2 || !$email || !$name || !birthday || !$habboname || !$habbohotel){
- echo("<font color=\"red\"><strong>You left some important fields empty!</strong><br/><br/></font>");
- registration();
- }elseif(strlen($username) >= 12){
- echo("<font color=\"red\"><strong>Your username cannot be greater than 12 characters!</strong><br/><br/></font>");
- registration();
- }elseif(strlen($rpass) >= 12){
- echo("<font color=\"red\"><strong>Your password cannot be greater than 12 characters!</strong><br/><br/></font>");
- registration();
- }elseif(strlen($email) >= 45){
- echo("<font color=\"red\"><strong>Your email cannot be greater than 45 characters!</strong><br/><br/></font>");
- registration();
- }elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){
- echo("<font color=\"red\"><strong>It seems the email entered is invalid!</strong><br/><br/></font>");
- registration();
- }elseif(strlen($name) >= 20){
- echo("<font color=\"red\"><strong>Your name cannot be greater than 20 characters!</strong><br/><br/></font>");
- registration();
- }elseif(strlen($age) >= 3){
- echo("<font color=\"red\"><strong>Your age cannot be greater than 2 characters!</strong><br/><br/></font>");
- registration();
- }elseif(!is_numeric($age)){
- echo("Your age must be a number!");
- }elseif(strlen($birthday) >= 10){
- echo("<font color=\"red\"><strong>Your birthdate cannot be greater than 10 characters!</strong><br/><br/></font>");
- registration();
- }elseif(strlen($habboname) >= 12){
- echo("<font color=\"red\"><strong>Your habboname cannot be greater than 12 characters!</strong><br/><br/></font>");
- registration();
- }elseif(!$terms){
- echo("<font color=\"red\"><strong>You must tick the box to show you agree to our TOS before continuing!</strong><br/><br/></font>");
- registration();
- }elseif($password != $password2){
- echo("<font color=\"red\"><strong>It seems your passwords do not match!</strong><br/><br/></font>");
- registration();
- }elseif(strlen($rpass) < 4){
- echo("<font color=\"red\"><strong>Your password it too short!</strong><br/><br/></font>");
- registration();
- }elseif(!eregi("[0-9]", ($rpass))){
- echo("<font color=\"red\"><strong>Your password must at least contain one numeric value!</strong><br/></font>");
- registration();
- }elseif(eregi("[0-9]", ($name))){
- echo("Your name is weird to contain numbers?");
- $getuser = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'");
- $checkuser = mysql_num_rows($getuser);
- }elseif($checkuser){
- echo("Unfortunately the requested username was already taken!");
- registration();
- $getemail = mysql_query("SELECT * FROM `users` WHERE `email` = '$email'");
- $checkemail = mysql_num_rows($getemail);
- }elseif($checkemail){
- echo("Unfortunately the email entered has been used already!");
- registration();
- $gethabbo = mysql_query("SELECT * FROM `users` WHERE `habboname` = '$habboname'");
- $checkhabbo = mysql_num_rows($gethabbo);
- }elseif($checkhabbo){
- echo("Unfortunately the habbo name entered has been used already!");
- registration();
- }else{
- // Send an Email =]
- $to = "brentanoalfredo@yahoo.com";
- $subject = "$sitename Registration";
- $message = "Hello $username!,
- It seems that a visitor of $sitename has registered on our website using $email
- If this is not you please disregard this message.
- We'd like to thank you for choosing $sitename! Now that you have registered please remember these details:
- Username: $username
- Password: $rpass
- Please do not lose these details as they have been encrypted into our database and cannot be retrieved, though we do offer a 'Forgot Password' tool that allows you to reset your password.
- Now that you are an registered user at $sitename, you may now login to your account with the specified details above! At $sitename we offer you the ability to manage your uploads, send private messages, and much more!
- Sincerely, Alfredo Morales
- $sitename Owner
- P.S Please do not respond to this email as we cannot reply to your inquiries, if you have need of contacting us please use the site contact tool located at $sitepath";
- $from = "no-reply@$sitename";
- $headers = "From: $from";
- mail($to,$subject,$message,$headers);
- // Insert the info in the DB
- $getinn = mysql_query("INSERT INTO `users` (`id` , `username` ,`password` , `habboname` , `habbohotel` , `rank` , `ip` , `uploadcount`)
- VALUES ('NULL', '".$username."', '".$password."', '".$habboname."', '".$habbohotel."', 'User', '".$ip."', '0')") or die(mysql_error());
- echo("Woo! Thank you ".$username." for registering at ".$sitename."! You should have received an email for more information, you may now sign in!");
- }
- }
- ?>
Add Comment
Please, Sign In to add comment