Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- include('config.php');
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta charset="utf-8">
- <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> -->
- <meta name="description" content="MMORPG Metin2">
- <meta name="viewport" content="width=device-width">
- <title>FondryMT2 - Oriental Action MMORPG</title>
- <link rel="stylesheet" href="style.css">
- </head>
- <body>
- <div id="registerForm">
- <h1>ENTRA NO MUNDO DO METIN2</h1>
- <p>Regista-te já e junta-te ao jogo gratuitamente!</p>
- <form action="index.php" method="post">
- <?PHP
- /*PHP BY OWSAP*/
- if(isset($_POST['submit'])) {
- $real_name = $_POST['real_name'];
- $username = $_POST['username'];
- $email = $_POST['email'];
- $password = $_POST['password'];
- $password2 = $_POST['password2'];
- $social_id = $_POST['social_id'];
- if(empty($real_name) || empty($username) || empty($email) ||
- empty($password) || empty($password2) || empty($social_id)) {
- echo '<font color="red">Por favor preenche todos os campos corretamente.</font><hr></br>';
- }
- //elseif(!preg_match("/^[a-zA-Z\s,.'-\pL]+$/u", $real_name)) {
- elseif(!preg_match("/^([ \x{00C0}-\x{01FF}a-zA-Z\'\-])+$/u", $real_name)) {
- echo '<font color="red">Por favor insere um nome válido.</font><hr></br>';
- }
- elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)) {
- echo '<font color="red">Por favor insere um e-mail válido.</font><hr></br>';
- }
- elseif($password != $password2) {
- echo '<font color="red">A palavra-passe não é igual à que repetiste.</font><hr></br>';
- }
- else {
- $existing_user = "SELECT login FROM account WHERE login = '".$username."'";
- $existing_email = "SELECT email FROM account WHERE email = '".$email."'";
- $check_user = mysqli_query($connection, $existing_user);
- $check_email = mysqli_query($connection, $existing_email);
- if(mysqli_num_rows($check_user) != 0) {
- echo '<font color="red">Este utilizador já está registado.</font><hr></br>';
- }
- elseif(mysqli_num_rows($check_email) != 0) {
- echo '<font color="red">Este e-mail já está registado.</font><hr></br>';
- }
- elseif(strlen($real_name) > 30 || strlen($real_name) < 3 ||
- strlen($username) > 16 || strlen($username) < 5 ||
- strlen($password) > 16 || strlen($password) < 5 ||
- strlen($email) > 40 ||
- strlen($social_id) != 7) {
- echo '<font color="red">Por favor verifique novamente o requisitos para cada campo.</font><hr></br>';
- }
- else {
- $connection->query("SET NAMES utf8");
- //$sql = "INSERT INTO account SET login = '".$username."', password = PASSWORD('".$password."'), social_id = '".$social_id."', real_name = '".$real_name."', email = '".$email."'";
- $sql = "INSERT INTO account (login, password, social_id, real_name, email) VALUES ('".$username."', PASSWORD('".$password."'), '".$social_id."', '".$real_name."', '".$email."')";
- $result = mysqli_query($connection, $sql);
- if($result) {
- echo '<font color="green">O teu registo foi efectuado com sucesso.</font><hr></br>';
- }
- else {
- echo '<font color="red">Houve um erro ao registar. Por favor tenta mais tarde ou contacte com a administração.</font><hr></br>';
- }
- }
- }
- }
- ?>
- <label>Seu nome real:</label>
- <input type="text" name="real_name" placeholder="Nome Real" maxlength="30" />
- <label>Nome da conta: </br><small>(Entre 5 e 16 caracteres permitidos)</small></label>
- <input type="text" name="username" placeholder="Nome da conta" maxlength="16" />
- <label>E-Mail:</label>
- <input type="text" name="email" placeholder="E-Mail" maxlength="40" />
- <label>Palavra-passe: </br><small>(Entre 5 e 16 caracteres permitidos)</small></label>
- <input type="password" name="password" placeholder="Palavra-passe" maxlength="16" />
- <label>Repete a palavra-passe:</label>
- <input type="password" name="password2" placeholder="Repete a palavra-passe" maxlength="16" />
- <label>Código de apagar personagem: </br><small>(7 caracteres obrigatórios)</small></label>
- <input type="text" name="social_id" placeholder="Código de apagar personagem" maxlength="7" />
- <div class="submit_btn_wrapper">
- <input type="submit" name="submit" class="btn_submit" value="REGISTAR" />
- </div>
- </form>
- </div>
- <div class="footer">
- <div id="footerWrapper">
- <div class="logos">
- <div class="gameforge_logo"></div>
- </div>
- <p class="legal_line">
- © 2016 FONDRYMT2, INC. Todos os direitos reservados.
- </p>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement