Guest User

Untitled

a guest
Jul 9th, 2018
1,193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.75 KB | None | 0 0
  1. <?
  2. // This usersystem has been created for the use of ShareHabbo.NET
  3. // This system has been created by Alfredo Morales
  4. // All of it's content is copyrighted to Alfredo Morales
  5. // Any reproduction of this system without the permission of Alfredo Morales is not allowed
  6. // For more information contact Alfredo at brentanoalfredo@yahoo.com
  7. session_start();
  8. include("inc/config.php");
  9. if(isset($_SESSION['username'])){
  10. header("Location: index.php");
  11. die();
  12. }
  13. echo("<link href=\"../css/register.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />");
  14. ?>
  15. <?
  16. if(!isset($_POST[submit])){
  17. ?>
  18. <strong>Register at <? echo("$sitename"); ?></strong><br/>
  19. <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>
  20. <p>Please enter the following details:</p>
  21.  
  22. <?
  23. include("func.reg.php");
  24.  
  25. registration();
  26.  
  27. }else{
  28.  
  29. include("func.reg.php");
  30.  
  31. // Change the POST's into variables
  32.  
  33. $username = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['username'])));
  34. $password = md5($_POST['password']);
  35. $password2 = md5($_POST['passwordc']);
  36. $rpass = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['password'])));
  37. $email = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['email'])));
  38. $name = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['name'])));
  39. $age = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['age'])));
  40. $birthday = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['birthday'])));
  41. $habboname = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['habboname'])));
  42. $habbohotel = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['habbohotel'])));
  43. $terms = $_POST['terms'];
  44.  
  45. // Check to make sure the info is valid
  46.  
  47. $ip = $_SERVER['REMOTE_ADDR'];
  48.  
  49. $getip = mysql_query("SELECT * FROM `users` WHERE `ip` = '$ip'");
  50. $checkip = mysql_num_rows($getip);
  51.  
  52. if(!$checkip){
  53. echo("Unfortunately you already have an account!");
  54.  
  55.  
  56. }elseif(!$username || !password || !$password2 || !$email || !$name || !birthday || !$habboname || !$habbohotel){
  57. echo("<font color=\"red\"><strong>You left some important fields empty!</strong><br/><br/></font>");
  58. registration();
  59.  
  60.  
  61. }elseif(strlen($username) >= 12){
  62. echo("<font color=\"red\"><strong>Your username cannot be greater than 12 characters!</strong><br/><br/></font>");
  63. registration();
  64.  
  65. }elseif(strlen($rpass) >= 12){
  66. echo("<font color=\"red\"><strong>Your password cannot be greater than 12 characters!</strong><br/><br/></font>");
  67. registration();
  68.  
  69.  
  70. }elseif(strlen($email) >= 45){
  71. echo("<font color=\"red\"><strong>Your email cannot be greater than 45 characters!</strong><br/><br/></font>");
  72. registration();
  73.  
  74.  
  75. }elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){
  76. echo("<font color=\"red\"><strong>It seems the email entered is invalid!</strong><br/><br/></font>");
  77. registration();
  78.  
  79.  
  80. }elseif(strlen($name) >= 20){
  81. echo("<font color=\"red\"><strong>Your name cannot be greater than 20 characters!</strong><br/><br/></font>");
  82. registration();
  83.  
  84.  
  85. }elseif(strlen($age) >= 3){
  86. echo("<font color=\"red\"><strong>Your age cannot be greater than 2 characters!</strong><br/><br/></font>");
  87. registration();
  88.  
  89. }elseif(!is_numeric($age)){
  90. echo("Your age must be a number!");
  91.  
  92.  
  93. }elseif(strlen($birthday) >= 10){
  94. echo("<font color=\"red\"><strong>Your birthdate cannot be greater than 10 characters!</strong><br/><br/></font>");
  95. registration();
  96.  
  97.  
  98. }elseif(strlen($habboname) >= 12){
  99. echo("<font color=\"red\"><strong>Your habboname cannot be greater than 12 characters!</strong><br/><br/></font>");
  100. registration();
  101.  
  102.  
  103. }elseif(!$terms){
  104. echo("<font color=\"red\"><strong>You must tick the box to show you agree to our TOS before continuing!</strong><br/><br/></font>");
  105. registration();
  106.  
  107.  
  108. }elseif($password != $password2){
  109. echo("<font color=\"red\"><strong>It seems your passwords do not match!</strong><br/><br/></font>");
  110. registration();
  111.  
  112.  
  113. }elseif(strlen($rpass) < 4){
  114. echo("<font color=\"red\"><strong>Your password it too short!</strong><br/><br/></font>");
  115. registration();
  116.  
  117.  
  118. }elseif(!eregi("[0-9]", ($rpass))){
  119. echo("<font color=\"red\"><strong>Your password must at least contain one numeric value!</strong><br/></font>");
  120. registration();
  121.  
  122. }elseif(eregi("[0-9]", ($name))){
  123. echo("Your name is weird to contain numbers?");
  124.  
  125.  
  126.  
  127. $getuser = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'");
  128. $checkuser = mysql_num_rows($getuser);
  129.  
  130. }elseif($checkuser){
  131. echo("Unfortunately the requested username was already taken!");
  132. registration();
  133.  
  134.  
  135. $getemail = mysql_query("SELECT * FROM `users` WHERE `email` = '$email'");
  136. $checkemail = mysql_num_rows($getemail);
  137.  
  138.  
  139. }elseif($checkemail){
  140. echo("Unfortunately the email entered has been used already!");
  141. registration();
  142.  
  143.  
  144. $gethabbo = mysql_query("SELECT * FROM `users` WHERE `habboname` = '$habboname'");
  145. $checkhabbo = mysql_num_rows($gethabbo);
  146.  
  147. }elseif($checkhabbo){
  148. echo("Unfortunately the habbo name entered has been used already!");
  149. registration();
  150.  
  151. }else{
  152.  
  153. // Send an Email =]
  154.  
  155. $to = "brentanoalfredo@yahoo.com";
  156. $subject = "$sitename Registration";
  157. $message = "Hello $username!,
  158.  
  159. It seems that a visitor of $sitename has registered on our website using $email
  160. If this is not you please disregard this message.
  161.  
  162. We'd like to thank you for choosing $sitename! Now that you have registered please remember these details:
  163.  
  164. Username: $username
  165. Password: $rpass
  166.  
  167. 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.
  168.  
  169. 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!
  170.  
  171. Sincerely, Alfredo Morales
  172. $sitename Owner
  173.  
  174. 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";
  175.  
  176. $from = "no-reply@$sitename";
  177. $headers = "From: $from";
  178. mail($to,$subject,$message,$headers);
  179.  
  180.  
  181. // Insert the info in the DB
  182.  
  183. $getinn = mysql_query("INSERT INTO `users` (`id` , `username` ,`password` , `habboname` , `habbohotel` , `rank` , `ip` , `uploadcount`)
  184. VALUES ('NULL', '".$username."', '".$password."', '".$habboname."', '".$habbohotel."', 'User', '".$ip."', '0')") or die(mysql_error());
  185. echo("Woo! Thank you ".$username." for registering at ".$sitename."! You should have received an email for more information, you may now sign in!");
  186.  
  187.  
  188. }
  189. }
  190. ?>
Add Comment
Please, Sign In to add comment