Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // [ NosMagic - Offiziele Website ] Copyright by [WebDev]Rhyme , Made by [WebDev]Rhyme alias E-PvP: Ortator
- require_once '../news/index/config.php';
- if($_POST){
- $user_name = $_POST['username'];
- $user_email = $_POST['mail'];
- $user_password = $_POST['password'];
- $user_passwordrepeat = $_POST['passwordRepeat'];
- if($user_password != $user_passwordrepeat){
- echo "passrepeatfalse";
- return;
- }
- if(!filter_var($user_email, FILTER_VALIDATE_EMAIL) === true) {
- echo "emailfail";
- return;
- }
- if (!preg_match('/^[0-9a-z]+$/i', $user_name)) {
- echo 'failusernamesonder';
- return;
- }
- if (!preg_match('/^[0-9a-z]+$/i', $user_password)) {
- echo 'failpasswortsonder';
- return;
- }
- if(strlen($user_name) > 16){
- echo 'fehlerquery';
- return;
- }
- if(strlen($user_email) > 60){
- echo 'fehlerquery';
- return;
- }
- if(strlen($user_password) > 16){
- echo 'fehlerquery';
- return;
- }
- if(strlen($user_passwordrepeat) > 16){
- echo 'fehlerquery';
- return;
- }
- $stmt = $conn->prepare("SELECT TOP 1 COUNT(*) AS AnzahlX FROM $db_Account WHERE [Email] = :e_adress");
- $stmt->bindParam(':e_adress', $user_email);
- if ($stmt->execute()){
- $row = $stmt->fetch();
- if ($row['AnzahlX'] != 0){
- echo "email_used";
- return;
- }
- }else{
- echo "fehlerquery";
- return;
- }
- $joining_date= date("j-m-y H:i:s");
- $stmt = $conn->prepare("SELECT TOP 1 COUNT(*) AS Anzahl FROM $db_Account WHERE [Name] = :xname ");
- $stmt->bindParam(':xname', $user_name);
- if ($stmt->execute()){
- $row = $stmt->fetch();
- if ($row['Anzahl'] == 0){
- $ip_address = $_SERVER['REMOTE_ADDR'];
- $stmt = $conn->prepare("INSERT INTO $db_Account(Authority,Email, Name, Password, RegistrationIP,VerificationToken) VALUES(:'?','?','?','?','?','?')");
- $stmt->bindParam(':passwort', hash('sha512',$user_password));
- if($stmt->execute()){'0',$_POST['mail'],$_POST['username'],$password, $ip_address,'0']))}
- echo "accountreg";
- session_start();
- if(empty($_SESSION['User']))
- {
- session_regenerate_id();
- $_SESSION['User'] = $user_name;
- }
- if(empty($_SESSION['passwort']))
- {
- session_regenerate_id();
- $_SESSION['passwort'] = hash('sha512',$user_password);
- }
- }
- else{echo "fehlerquery";}
- }else{
- echo "usernamevorhanden";
- }
- }else{echo "fehlerquery";}
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement