Einfach mal selber Fragen unter https://www.polizei-brandenburg-karriere.de/?dbv3_man=defaultman

Falls du wirklich zur Polizei willst, kann ich dir sagen dass das für dich sehr problematisch wird^^

...zur Antwort

Noch etwas vergessen, damit ihr euch das selber angucken könnt.

Das Script: 

<?phpinclude("utils.php");// Check if all the variables are setif ((isset($_POST["UserID"])) && (isset($_POST["Passwordreg"])) && (isset($_POST["email"])) && (isset($_POST["Display_Name"]))) {// The username$username = sanitize($_POST["UserID"]);// The password$password = sanitize($_POST["Passwordreg"]);// The email address$email = $_POST["email"];// The Display Name$display_name = sanitize($_POST["Display_Name"]);// Check the length of the new passwordif (((strlen($password) <= 12) && (strlen($password) >= 3)) && ((strlen($username) <= 12) && (strlen($username) >= 3))) {// If the email is validif (filter_var($email, FILTER_VALIDATE_EMAIL)) {// Require the database configurationrequire_once("../database/config.php");// Check if the username exists$check_user_query = $con->prepare("SELECT UserUID FROM PS_UserData.dbo.Users_Master WHERE UserID = ? OR Email = ?");$check_user_query->bindValue(1, $username, PDO::PARAM_STR);$check_user_query->bindValue(2, $email, PDO::PARAM_STR);// Execute the query$check_user_query->execute();// The user row$user_row = $check_user_query->fetch();// If a row was returnedif ($user_row) {// echo errorecho "The supplied username or email already exists!";;die();}//Check the display name$check_display_query = $con->prepare("SELECT UserName FROM PS_UserData.dbo.Users_Detail WHERE Username = ?");//Bind the Value$check_display_query->bindValue(1, $display_name, PDO::PARAM_STR);//Execute the query$check_display_query->execute();// The name row$name_row = $check_display_query->fetch();// If a row was returnedif ($name_row) {// Return to the change password screenecho "This Display Name is already used!";die();}// The verify key$verify_key = md5(substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10));// The ip of the user$user_ip = $_SERVER['REMOTE_ADDR'];// The query to insert the values$insert_query = $con->prepare("INSERT INTO PS_UserData.dbo.Users_Master (UserID, Pw, Admin, AdminLevel, UseQueue, Status, Leave, LeaveDate, UserType, Point, Enpassword, UserIp, Email)VALUES (?, ?, ?, ?, ?, ?, ?, GETDATE(), ?, ?, ?, ?, ?) ");// Bind the values$insert_query->bindValue( 1, $username, PDO::PARAM_STR );$insert_query->bindValue( 2, $password, PDO::PARAM_STR );$insert_query->bindValue( 3, 0, PDO::PARAM_INT );$insert_query->bindValue( 4, 0, PDO::PARAM_INT );$insert_query->bindValue( 5, 0, PDO::PARAM_INT );$insert_query->bindValue( 6, '0', PDO::PARAM_STR );$insert_query->bindValue( 7, 0, PDO::PARAM_INT );$insert_query->bindValue( 8, 'N', PDO::PARAM_STR );$insert_query->bindValue( 9, 0, PDO::PARAM_INT );$insert_query->bindValue( 10, '', PDO::PARAM_STR );$insert_query->bindValue( 11, $user_ip, PDO::PARAM_STR );$insert_query->bindValue( 12, $email, PDO::PARAM_STR );// Execute the query$insert_query->execute();//Insert into details$details_query = $con->prepare("INSERT INTO PS_UserData.dbo.Users_Detail (UserID, UserUID, UserName, Email, JoinDate) VALUES (?, (SELECT UserUID FROM PS_UserData.dbo.Users_Master WHERE UserID = ?), ?, ?, ?, ?, GETDATE())");//Bind Values$details_query->bindValue(1, $username, PDO::PARAM_STR);$details_query->bindValue(2, $username, PDO::PARAM_STR);$details_query->bindValue(3, $display_name, PDO::PARAM_STR);$details_query->bindValue(4, $email, PDO::PARAM_STR);//Execute the query$details_query->execute();// Start the sessionsession_start();// Store the user id$_SESSION["UserID"] = $username;// Store the display name$_SESSION["Username"] = $display_name;// Go to the index pageecho "Account Created";} else {// Return to the change password screenecho "The email provided is invalid!";}} else {// Return to the change password screen"The length of your username or password is invalid!";}}?>

Die Config:

<?php/*// The database host$DATABASE_HOST = "localhost";// The default database$DEFAULT_DATABASE = "PS_UserData";// The database login for the website$DATABASE_USER = "BALALALA";// The password$DATABASE_PASS = "BALALALA";// Create the connection$con = new PDO("sqlsrv:server=$DATABASE_HOST;database=$DEFAULT_DATABASE;", $DATABASE_USER, $DATABASE_PASS);*/$host = '127.0.0.1';$database = 'PS_UserData';$user = 'BALALALA';$password = 'BALALALA';$mssqldriver = '{SQL Server}'; $mssqldriver = '{SQL Server Native Client 11.0}';$mssqldriver = '{ODBC Driver 11 for SQL Server}';try {$con = new PDO("odbc:Driver={SQL Server Native Client 11.0};Server=$host", $user, $password);} catch (PDOException $e) {echo 'Connection failed: ' . $e->getMessage();die();}

Einfach Kopieren und in Notepad++ oder einem anderen

 

editor

 

tool einfügen damit man eine bessere Übersicht hat.

...zur Antwort