Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($register) {
- if (isset($_POST['username'])) {
- $check_login = $account->prepare("SELECT count(*) FROM account WHERE login = '".$_POST['username']."'");
- $check_login->execute();
- $check_login = $check_login->fetchColumn();
- $check_email = $account->prepare("SELECT count(*) FROM account WHERE email = '".$_POST['email']."'");
- $check_email->execute();
- $check_email = $check_email->fetchColumn();
- if($check_login>0)
- print '<div class="headline">
- <center><font color="red">Nume de utilizator indisponibil.</font></center>
- </div>';
- else if($check_email>0)
- print '<div class="headline">
- <center><font color="red">Acest e-mail este folosit deja de un</br></br> alt cont.</font></center>
- </div>';
- else {
- if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
- if($_POST['pw'] == $_POST['repeat_pw']) {
- $hash = "*" . sha1(sha1($_POST['pw'], true));
- $password = strtoupper($hash);
- if($bonus)
- $expire = "20221218131717"; //Data expirarii sanselor (2022-12-18 13:17:17)
- else
- $expire = "0";
- $sql = "INSERT INTO account(login,
- password,
- social_id,
- email,
- create_time,
- status,
- gold_expire,
- silver_expire,
- safebox_expire,
- autoloot_expire,
- fish_mind_expire,
- marriage_fast_expire,
- money_drop_rate_expire) VALUES (
- :login,
- :password,
- :social_id,
- :email,
- NOW(),
- :status,
- :gold_expire,
- :silver_expire,
- :safebox_expire,
- :autoloot_expire,
- :fish_mind_expire,
- :marriage_fast_expire,
- :money_drop_rate_expire)";
- $stmt = $account->prepare($sql);
- $stmt->bindParam(':login', $_POST['username'], PDO::PARAM_STR);
- $stmt->bindParam(':password', $password, PDO::PARAM_STR);
- $stmt->bindParam(':social_id', $_POST['delcode'], PDO::PARAM_STR);
- $stmt->bindParam(':email', $_POST['email'], PDO::PARAM_STR);
- $stmt->bindParam(':status', $status_register, PDO::PARAM_STR);
- $stmt->bindParam(':gold_expire', $expire, PDO::PARAM_STR);
- $stmt->bindParam(':silver_expire', $expire, PDO::PARAM_STR);
- $stmt->bindParam(':safebox_expire', $expire, PDO::PARAM_STR);
- $stmt->bindParam(':autoloot_expire', $expire, PDO::PARAM_STR);
- $stmt->bindParam(':fish_mind_expire', $expire, PDO::PARAM_STR);
- $stmt->bindParam(':marriage_fast_expire', $expire, PDO::PARAM_STR);
- $stmt->bindParam(':money_drop_rate_expire', $expire, PDO::PARAM_STR);
- $stmt->execute();
- print '<div class="headline">
- <center><font color="green">Contul tău a fost creat cu succes! </br></br>Te poți loga în joc.</font></center>
- </div>';
- }
- else
- print '<div class="headline">
- <center><font color="red">Parolele nu se potrivesc.</font></center>
- </div>';
- }
- else
- print '<div class="headline">
- <center><font color="red">Adresa de e-mail este invalidă.</font></center>
- </div>';
- }
- }
- ?>
- <form action="#registration" method="post">
- <input type="text" pattern=".{5,16}" maxlength="16" required="required" name="username" placeholder="Nume utilizator" />
- <div class="reg_info">
- Între 5 și 16 caractere. Trebuie să conțină litere și numere.
- </div>
- <input type="email" required="required" name="email" placeholder="E-mail" />
- <div class="reg_info">
- Trebuie să fie o adresă de e-mail validă.
- </div>
- <input id="reg_pw" pattern=".{5,}" type="password" required="required" name="pw" placeholder="Parolă" />
- <div class="reg_info">
- Cel puțin 5 caractere. Cel mai bun caz, cu litere mari și mici, numere și caractere speciale.
- </div>
- <input id="reg_pw2" pattern=".{5,}" type="password" required="required" name="repeat_pw" placeholder="Repetă parola" />
- <div class="reg_info">
- Scrie din nou parola de mai sus.
- </div>
- <input type="number" min="1000000" max="9999999" required="required" name="delcode" placeholder="Cod ștergere" id="delcodeInput"/>
- <div class="reg_info">
- Trebuie de 7 cifre. Litere și caractere speciale nu sunt permise.
- </div>
- <button class="btn" type="submit" name="submit">Înregistrare!</button>
- </form>
- <?php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement