Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Registration</title>
- <link href="https://fonts.googleapis.com/css?family=Raleway:400,700,900" rel="stylesheet">
- <link rel="stylesheet" href="form_style.css">
- </head>
- <body>
- <?php
- $connect = mysql_connect("localhost", "root","") or die(mysql_error());
- mysql_select_db("autorize");
- if (isset($_POST['submit']))
- {
- $username = $_POST['username'];
- $login = $_POST['login'];
- $password = $_POST['password'];
- $r_password = $_POST['password'];
- if ($password == $r_password){
- $password = md5($password);
- $zapros = "insert into users set name='".$username."', login='".$login."', password='".$password."'";
- $query = mysql_query($zapros) or die(mysql_error());
- }else{
- die ("Passwords must match!");
- }
- }
- ?>
- <div class="reg">
- <div class="al-reg">
- <form method="post" action="registr.php">
- <span>Registration</span><br>
- <input type="text" name="username" placeholder=" Username" required /><br>
- <input type="text" name="login" placeholder=" Login" required /><br>
- <input type="password" name="password" placeholder=" Password" required /><br>
- <input type="password" name="r_password" placeholder=" Repeat password" required /><br>
- <input type="submit" name="submit" value="Register" /><br>
- <a href="main.html">home page</a>
- </form>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement