Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('config.php');
- if($_SERVER["REQUEST_METHOD"]== "POST"){
- $myusername = mysqli_real_escape_string($db,$_POST['username']);
- $mypassword = mysqli_real_escape_string($db,$_POST['password']);
- $myemail = mysqli_real_escape_string($db,$_POST['email']);
- $validation = "SELECT username FROM carpool_ WHERE username = '$myusername'";
- $validResult = mysqli_query($db,$validation);
- $validCount = mysqli_num_rows($validResult);
- if ($validCount != 1){
- $sql = "INSERT INTO carpool_ (username, password, email) VALUES ('$myusername', '$mypassword' , '$myemail' )";
- $result = mysqli_query($db,$sql);
- }else{
- $duplicate = "This username is already installed";
- }
- }
- ?>
- <html>
- <head>
- <title>Register</title>
- <style type = "text/css">
- body {
- font-family:Arial, Helvetica, sans-serif;
- font-size:14px;
- }
- label {
- font-weight:bold;
- width:100px;
- font-size:14px;
- }
- .box {
- border:#666666 solid 1px;
- }
- </style>
- </head>
- <body bgcolor = "#FFFFFF">
- <div align = "center">
- <div style = "width:300px; border: solid 1px #333333; " align = "left">
- <div style = "background-color:#333333; color:#FFFFFF; padding:3px;"><b>Register</b></div>
- <div style = "margin:30px">
- <form action = "" method = "post">
- <label>Username :</label><br /><input type = "text" name = "username" class = "box" required/><br /><br />
- <label>Password :</label><br /><input type = "password" name = "password" class = "box" pattern=".{8,16}" required title="8 to 16 characters"/><br/><br />
- <label>Email :</label><br /><input type = "email" name = "email" class = "box" required/><br/><br />
- <input type = "submit" value = " Register "/><br />
- </form>
- <div style = "font-size:11px; color:#cc0000; margin-top:10px"></div>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement