Advertisement
Guest User

Untitled

a guest
Aug 8th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.09 KB | None | 0 0
  1. "; die($fullerror); } mysql_connect($dbhost, $dbuser, $dbpass)or error("Could not connect: ".mysql_error()); mysql_select_db($dbname) or error(mysql_error()); if (isset($_POST['submit'])) { if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) { error('You did not complete all of the required fields'); } if($_POST['colour'] >= 16){ error('Incorrect Colour'); } if (!get_magic_quotes_gpc()) { $_POST['username'] = addslashes($_POST['username']); } if(ereg("[^A-Za-z0-9_ #$%&'*+/=?^_`{|}~-<>]", $_POST['username'])){ error("Your name is invalid. Please try using letters numbers, and a few special characters"); } if(substr($_POST['username'], 0,1) == " " || substr(strrev($_POST['username']), 0,1) == " "){ error('Error in Username'); } $_POST['username'] = mysql_real_escape_string($_POST['username']); $_POST['pass'] = mysql_real_escape_string($_POST['pass']); $_POST['colour'] = mysql_real_escape_string($_POST['colour']); $_POST['email'] = mysql_real_escape_string($_POST['email']); if (!get_magic_quotes_gpc()) { $_POST['pass'] = addslashes($_POST['pass']); $_POST['email'] = addslashes($_POST['email']); $_POST['colour'] = addslashes($_POST['colour']); $_POST['username'] = addslashes($_POST['username']); } $usercheck = $_POST['username']; $check = mysql_query("SELECT username FROM $table WHERE username = '$usercheck'") or error(mysql_error()); $check2 = mysql_num_rows($check); $mailcheck = $_POST['email']; $check3= mysql_query("SELECT email FROM $table WHERE email = '$mailcheck'") or error(mysql_error()); $check4 = mysql_num_rows($check3); $ipcheck = $_SERVER['REMOTE_ADDR']; //$check5= mysql_query("SELECT ip FROM ip_bans WHERE ip = '$ipcheck'") //or error(mysql_error()); //$check6 = mysql_num_rows($check5); if(check_email_address($_POST['email']) == false){ error("Invalid Email!"); } if ($check2 != 0) { error('Sorry, the username '.$_POST['username'].' is already in use.'); } if ($check4 != 0) { error('Sorry, the email address '.$_POST['email'].' is already in use.'); } // if ($check6 != 0) { // error('Sorry, it seems that you are IP banned. If you believe this was a mistake, please contact a staff member on the chat.'); // } if ($_POST['pass'] != $_POST['pass2']) { error('Your passwords did not match. '); } if(strlen($_POST['pass']) <= 3){ error('Your password is too short! '); } $_POST['pass'] = md5($_POST['pass']); $ip = $_SERVER['REMOTE_ADDR']; if($ip == "78.144.144.168"){ error("Sorry bro. You quit."); } $insert = "INSERT INTO $table (`id`, `username`, `nickname`, `email`, `password`, `active`, `ubdate`, `items`, `curhead`, `curface`, `curneck`, `curbody`, `curhands`, `curfeet`, `curphoto`, `curflag`, `colour`, `buddies`, `ignore`, `joindate`, `lkey`, `coins`, `ismoderator`, `rank`, `ips`) VALUES (NULL, '".$_POST['username']."', '".$_POST['username']."', '".$_POST['email']."', '".$_POST['pass']."', '1', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '".$_POST['colour']."', '', '', CURRENT_TIMESTAMP, '', '1000', '0', '1', '".$ip."')"; $log = "Username: ".$_POST['username']." Pass:".$_POST['pass']." Colour:".$_POST['colour']." Email:".$_POST['email']." IP:".$ip." \n"; $add_member = mysql_query($insert); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement