Nech sa páči ->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Admin Panel © <?php $date = date("Y"); echo "$date"; ?></title>
<!-- BOOTSTRAP STYLES-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FONTAWESOME STYLES-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- CUSTOM STYLES-->
<link href="assets/css/custom.css" rel="stylesheet" />
<!-- GOOGLE FONTS-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
<div id="wrapper">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="adjust-nav">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<span class="logout-spn" >
<a href="#" style="color:#fff;">PRIHLÁSIŤ SA</a>
</span>
</div>
</div>
<!-- /. NAV TOP -->
<nav class="navbar-default navbar-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="main-menu">
<li>
<a href="login.php">Prihlásiť sa</a>
</li>
<li class="active-link">
<a href="register.php">Registrácia</a>
</li>
</ul>
</div>
</nav>
<!-- /. NAV SIDE -->
<div id="page-wrapper" >
<div id="page-inner">
<div class="row">
<div class="col-md-12">
<h2>ZAREGISTROVAŤ SA</h2>
</div>
</div>
<!-- /. ROW -->
<hr />
<center>
<form action="#" method="post">
Username: <sup style="color: #FF0000;">Required!</sup> <input type="text" name="nickname" pattern="[a-zA-Z0-9]+" class="form-control" required=""><br>
Heslo: <sup style="color: #FF0000;">Required!</sup> <input type="password" name="pwd1" class="form-control" required=""><br>
Heslo znovu: <sup style="color: #FF0000;">Required!</sup> <input type="password" name="pwd2" class="form-control" required=""><br>
E-mail: <sup style="color: #FF0000;">Required!</sup> <input type="email" name="email" class="form-control" required=""><br>
ANTI-SPAM <sup style="color: #FF0000;">Zadajte aktuálny rok</sup> <input type="text" name="rok" pattern="[0-9]+" class="form-control" required=""><br>
<input type="submit" value="Vytvoriť účet" name="submitForm" class="btn btn-success"><br><br>
<?php
$nickname = $_POST['nickname'];
$pwd1 = md5($_POST['pwd1']);
$pwd2 = md5($_POST['pwd2']);
$mail = $_POST['email'];
$antispam = $_POST['rok'];
$submit = $_POST['submitForm'];
$existujen = mysqli_query($mysqli, "SELECT * FROM users WHERE nickname='".$nickname."'");
if (isset($submit)) {
$mysql_server = "localhost";
$mysql_user = "root";
$mysql_password = "NoNE";
$mysql_db = "newdb";
$mysqli = new mysqli($mysql_server, $mysql_user, $mysql_password, $mysql_db);
if ($mysqli->connect_errno) {
printf("Connection failed: %s \n", $mysqli->connect_error);
exit();
}
$mysqli->set_charset("utf8");
if ($pwd1 == $pwd2) {
if ($antispam == date("Y")) {
if (mysqli_num_rows($existujen) > 0) {
echo "Užívateľ s týmto nick-om už existuje!";
} else {
if ($existujem) {
echo "Užívateľ s týmto e-mail-om už existuje!";
} else {
mysqli_query($mysqli, "INSERT INTO users (nickname, password, mail) VALUES ('$nickname', '$pwd1', '$mail')");
$_SESSION['nickname'] = $nickname;
echo "Váš účet bol vytvorený! Môžete sa <a href=\"login.php\">prihlásiť</a>.";
header("refresh:3; url=register.php");
}
}
} else {
echo "CHYBA: Zle vyplnený anti-spam!";
header("refresh:3; url=register.php");
}
} else {
echo "CHYBA: Heslá nesúhlasia!";
header("refresh:3; url=register.php");
}
}
?>
</form>
</center>
<!-- /. ROW -->
</div>
<!-- /. PAGE INNER -->
</div>
<!-- /. PAGE WRAPPER -->
</div>
<div class="footer">
<div class="row">
<div id="col-lg-12">
© <?php echo "$date"; ?> By RayCodeUwU | Všetky práva vyhradené!
</div>
</div>
</div>
<!-- /. WRAPPER -->
<!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
<!-- JQUERY SCRIPTS -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- CUSTOM SCRIPTS -->
<script src="assets/js/custom.js"></script>
</body>
</html>
Vyskúšaj si to skopírovať do svojho .php súboru, a pokiaľ ti to pôjde bez problémov, tak mám asi pokazené VPS... Lebo mne to skrátka stále nejde.