Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- echo "<h1>Register</h1>";
- $submit = $_POST['submit'];
- $fullname = strip_tags($_POST['fullname']);
- $username = strip_tags($_POST['username']);
- $password = strip_tags($_POST['password']);
- $repeatpassword = strip_tags($_POST['repeatpassword']);
- $date = date("Y-m-d");
- if($submit)
- {
- if($username&&$password&&$repeatpassword&&$fullname)
- {
- $password = md5($password);
- $repeatpassword = md5($repeatpassword);
- if ($password==$repeatpassword)
- {
- if (strlen($username)>25||strlen($fullname)>25)
- {
- echo "Max length of username/fullname 25 chars";
- }
- else
- {
- //password length
- if (strlen($password)>25)||strlen($password)<6)
- {
- echo "Password must be between 6 and 25 chars";
- }
- else
- {
- // register user
- echo "Success";
- }
- }
- }
- else
- {
- echo "You passwords do not match";
- }
- }
- echo "Please fill in all all fields.";
- }
- ?>
- <html>
- <form action='register.php' method='POST'>
- <table summary="" >
- <tr>
- <td>
- Your full name:
- </td>
- <td>
- <input type='text' name='fullname'>
- </td>
- </tr>
- <tr>
- <td>
- Choose a username:
- </td>
- <td>
- <input type='text' name='username'>
- </td>
- </tr>
- <tr>
- <td>
- Choose a password:
- </td>
- <td>
- <input type='password' name='password'>
- </td>
- </tr>
- <tr>
- <td>
- Repeat password:
- </td>
- <td>
- <input type='password' name='repeatpassword'>
- </tr>
- </table>
- <p>
- <input type="submit" name="submit" value="Register"
- </form>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement