• DISCORD CHAT At https://discord.gg/tfRXDnh To View Our Forum must be registered!!! RULES ARE ALL POSITIVE COMMENT CANT RESPECT OUR PLAYER AND STAFF IT AUTO BANNED NO ACCEPTION!!!!

Registration Script Warmonger Edited By HIRELC Safe

admin

Administrator
Staff member
#1
PHP:
<?php
    include_once("config.php");
?>
<html>

    <head>
        <title>HireLC - Dev Community LC</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
  
    <body>

        <header id="head" >
        <p>HireLC Registration</p>

 <center><IMG SRC="logo.png" ALT="" WIDTH=500 HEIGHT=175></center>
                  
        </header>
    <div id="main-wrapper">
            <div id="register-wrapper">
                <form method="post">





</html>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?php
$mysql = array(
    'dbserver' => "localhost",
    'database' => "auth",
    'username' => "root",
    'password' => "mastermind");

// Create DSN
$dsn = sprintf("mysql:host=%s;dbname=%s", $mysql['dbserver'], $mysql['database']);

// Connect To Database
try {
    $db = new PDO($dsn, $mysql['username'], $mysql['password']);
} catch (PDOException $error) {
    die($error->getMessage());
}

echo "<center>";

if ($_POST['active'] == 1) {

    // Post Variables
     $salt_tochangepass = 'phoohie1yaihooyaequae7PuiWoeNgahjieth3ru3yeeghaepahb7aeYaipe2we6zii6mai6uweig8siasheinoungeoyeiLohShi2xoh2xi8ooxee9ahpiehahc9Phe';
     $new_salt_pass = strtoupper(hash("sha256",$user.$salt_tochangepass.$pass));

    $user = $_POST['user'];
    $pass = $_POST['pass'];
    $pseudo = bin2hex(openssl_random_pseudo_bytes(33));
    // Check Input
    if (empty($user) || empty($pass)) {
        die("You did not fill in all of the required fields.<br /><a href='javascript:history.back()'>Go Back</a>");
    } elseif (strlen($user) < 4 || strlen($user) > 12) {
        die("Your username must be alphanumeric and at least 4-12 characters long.<br /><a href='javascript:history.back()'>Go Back</a>");
    } elseif (strlen($pass) < 4 || strlen($pass) > 12) {
        die("Your password must be alphanumeric and at least 4-12 characters long.<br /><a href='javascript:history.back()'>Go Back</a>");
    }
    
    // MD5 Hash The Password
    $pMD5 = strtoupper(hash("sha256",$user.$salt_tochangepass.$pass));

    // Check For Existing Accounts Using Post ID
    $dbh = $db->prepare("SELECT * FROM bg_user WHERE `user_id` = :user");
    $dbh->bindParam(':user', $user, PDO::PARAM_STR, 12);
    $dbh->execute();

    // No Rows Found (Account Does Not Exist)
    if ($dbh->rowCount() == 0) {
        // Register The Account
        $dbh = $db->prepare("INSERT INTO bg_user (user_id,passwd) VALUES (:user, :pass);");
        $dbh->bindParam(':user', $user, PDO::PARAM_STR, 12);
        $dbh->bindParam(':pass', $pMD5, PDO::PARAM_STR, 32);
        $dbh->execute();
        // Account Registered
        if ($dbh->rowCount() == 1) {
            die("Account Registered Successfully!<br /><a href='javascript:history.back()'>Go Back</a>");

        } else {

            die($dbh->errorInfo());
        }
    } else {
        // Account Exists
        die("Account Already Exists!<br /><a href='javascript:history.back()'>Go Back</a>");
    
    }
} else {
    echo "<form action='" . $_SEVER['PHP_SELF'] . "' method='POST'>";
    

    
    echo "<tr><td>Username:</td><td></td><td><input type='text' name='user' maxlength='12'></td></tr>";

    echo "<tr><td>Password:</td><td></td><td><input type='password' name='pass' maxlength='12'></td></tr>";
    echo "<tr><td colspan='2' align='center'>
        <input type='hidden' name='active' value='1'>
        <input type='submit' value='Create Account'></td></tr>";
    
    echo "</form>";
}
echo "</center>";
?>
<!DOCTYPE html>
<html>
    <head>
        <title>HireLC - Dev Community LC</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
    </head>

</li>
</div>
</div>
 </html>