<?php
// Includes
require __DIR__.'/includes/db.php';
phpinfo()
// Define security Variable
$pSecurity = $_POST['security'];
// Start Hourboost
if (array_key_exists('username', $_POST) && array_key_exists('password', $_POST) && array_key_exists('games', $_POST)) {
$sUser = $_POST['username'];
$sPass = $_POST['password'];
$sGames = $_POST['games'];
$sUserHTML = htmlspecialchars($sUser, ENT_QUOTES);
// Search for duplicate account
$dupUser = $db->query('SELECT username FROM accounts WHERE username=?', [
$sUser
]);
$dupUser = $dupUser->fetch_assoc();
// Convert dupUser Array to String
$dupUserString = implode("", $dupUser);
// If account already in database
if ($dupUser > 0) {
//do nothing
} else {
if ($pSecurity == 1 && array_key_exists('mobileAuth', $_POST)) {
$sAuth = $_POST['mobileAuth'];
// Insert into database
$db->query('INSERT INTO accounts (username, password, secret, games) VALUES (?, ?, ?, ?)', [
$sUser,
$sPass,
$sAuth,
$sGames
]);
} else if ($pSecurity == 2 && array_key_exists('steamGuard', $_POST)) {
$sGuard = $_POST['steamGuard'];
// Insert into database
$db->query('INSERT INTO accounts (username, password, sentry, games) VALUES (?, ?, ?, ?)', [
$sUser,
$sPass,
$sGuard,
$sGames
]);
} else if ($pSecurity === NULL) {
// Insert into database
$db->query('INSERT INTO accounts (username, password, games) VALUES (?, ?, ?)', [
$sUser,
$sPass,
$sGames
]);
} else {
// Insert into database
$db->query('INSERT INTO accounts (username, password, games) VALUES (?, ?, ?)', [
$sUser,
$sPass,
$sGames
]);
}
}
}
?>