Email:
Heslo:

set_charset("utf8"); if ($_SERVER["REQUEST_METHOD"] === "POST") { if (isset($_POST["email"]) && isset($_POST["heslo"])) { $email = htmlspecialchars(trim($_POST["email"])); $heslo = trim($_POST["heslo"]); if (strlen($heslo) < 8) { echo "

Chyba, heslo musí mít alespoň 8 znaků

"; } else { if (strlen($email) > 3 && strlen($email) <= 100) { $dotaz = $db->prepare("SELECT uzivatele_registrace.email FROM uzivatele_registrace WHERE uzivatele_registrace.email LIKE ?"); $dotaz->bind_param("s", $email); $dotaz->execute(); $vysledek = $dotaz->get_result(); if ($vysledek->num_rows == 0) { $heslo = "uigtunAFisofjoeGOP".$heslo."4fw8fe4gAWudjwof48"; $hash = hash("sha512", $heslo); $hash = "fskoef784QW65fs53Xpwqfk".$hash; $hash = hash("sha512", $hash); $cas = time(); $dotaz = $db->prepare("INSERT INTO uzivatele_registrace (email, heslo, cas) VALUE (?, ?, ?)"); $dotaz->bind_param("ssi", $email, $hash, $cas); $dotaz->execute(); } else { echo "

Chyba, tento email je již registrován

"; } } } } print_r($_POST); } ?>