Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("../modules/include/Config.php");
- require_once("../modules/include/sqlConn.php");
- require_once("../modules/include/Security.php");
- mssql_select_db($dbName1, $dbConn) or die ("Couln't select database $dbName1");
- if ($_POST['password1'] != $_POST['password2']) {
- header("location:./../?pwMissmatch");
- } else if (empty($_POST['nickname']) || empty($_POST['password1']) || empty($_POST['password2']) || empty($_POST['username'])) {
- header("location:./../?noData");
- } else {
- $check = new security();
- $message = null;
- if($check->is_secure($_POST['username']) == false) $message[] = "";
- if ($check->is_secure($_POST['password1']) == false) $message[] = "";
- if ($check->is_secure($_POST['password2']) == false) $message[] = "";
- if ($check->is_secure($_POST['nickname']) == false) $message[] = "";
- if(strlen($_POST['username']) < 3) $message[] = "Username too short";
- if(strlen($_POST['username']) > 16)$message[] = "Username too long";
- if(strlen($_POST['password1']) < 6) $message[] = "Password [1] too short";
- if(strlen($_POST['password1']) > 32)$message[] = "Password [1] too long";
- if(strlen($_POST['password2']) < 6) $message[] = "Password [2] too short";
- if(strlen($_POST['password']) > 32) $message[] = "Password [2] too long";
- if(count($message) > 0) {
- for($i = 0; $i < count($message); $i++) {
- print $message[$i];
- header("location:./../?invalidData");
- }
- return;
- } else {
- $username = $_POST['username'];
- $password = md5($_POST['password2']);
- $nickname = $_POST['nickname'];
- $verifyAccount = mssql_num_rows(mssql_query("select * from TB_User where StrUserID = '$username'"));
- if($verifyAccount > 0) {
- header("location:./../?NameExists");
- } else {
- mssql_query("exec _AddUser '$username','$password','$nickname',0,0,0,0,3,3,0");
- header("location:./../?regComplete");
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment