Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "<h1>Register</h1>";
- $submit = strip_tags($_POST['submit']);
- $fullname = strip_tags($_POST['fullname']);
- $username = strip_tags($_POST['username']);
- $password = md5(strip_tags($_POST['password']));
- $repeatpassword = md5(strip_tags($_POST['repeatpassword']));
- $date = date ("Y-m-d");
- if ($submit)
- { //1
- // check for existing details
- if ($fullname&&$username&&$password&&$repeatpassword)
- { // 2
- $password = md5($password);
- $repeatpassword = md5 ($repeatpassword);
- } // 2
- if ($password==$repeatpassword)
- { // 3
- } // 3
- else
- echo "your passwords do not match";
- if (strlen($username)>25||strlen ($fullname)>25)
- { // 4
- echo "Max char is 25";
- } // 4
- else
- // check username length
- if (strlen($password)>25||strlen($password)<6)
- { // 5
- echo "password must be between 6-25 characters";
- } // 5
- else
- //register user
- // was ere
- }
- ?>
- <html>
- <form action ='register.php' method ='POST'>
- <table>
- <tr>
- <td>
- Your full name:
- </td>
- <td>
- <input type ='text' name='fullname'>
- </td>
- </tr>
- <tr>
- <td>
- Username
- </td>
- <td>
- <input type ='text' name='username'>
- </td>
- </tr>
- <tr>
- <td>
- Password:
- </td>
- <td>
- <input type ='password' name='password'>
- </td>
- </tr>
- <tr>
- <td>
- Password (Repeat)
- </td>
- <td>
- <input type ='password' name='repeatpassword'>
- </td>
- </tr>
- </table>
- <p>
- <input type ='submit' name='submit' value='submit'>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement