Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Registrace</title>
- <link rel="stylesheet" href="css/style.css" />
- </head>
- <body>
- <?php
- require('db.php');
- if (isset($_POST['username'])){
- $username = $_POST['username'];
- $email = $_POST['email'];
- $password = $_POST['password'];
- $username = htmlentities($username);
- $username = mysql_real_escape_string($username);
- $email = htmlentities($email);
- $email = mysql_real_escape_string($email);
- $password = htmlentities($password);
- $password = mysql_real_escape_string($password);
- $trn_date = date("Y-m-d H:i:s");
- $query = "INSERT into `users` (username, password, email, trn_date) VALUES ('$username', '".sha1($password)."', '$email', '$trn_date')";
- $query = "INSERT INTO `usersmeta` (`id`, `key`, `value`) VALUES (" . mysql_insert_id() . ", 'rank', '1';");
- $result = mysql_query($query);
- if($result){
- echo "<div class='form'><h3>Registroval ses úspěšně.</h3><br/>Klikni zde <a href='login.php'>Login</a></div>";
- }
- }else{
- ?>
- <div class="form">
- <h1>Registrace</h1>
- <form name="registration" action="" method="post">
- <input type="text" name="username" placeholder="Username" required />
- <input type="email" name="email" placeholder="Email" required />
- <input type="password" name="password" placeholder="Password" required />
- <input type="submit" name="submit" value="Register" />
- </form>
- </div>
- <?php } ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement