Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "<h1>Register</h1>";
- error_reporting(0);
- if (isset($_POST["submit"]))
- {
- $submit=$_POST['submit'];
- $fullname=strip_tags($_POST['fullname']);// strip_tags=מוציא את כל האפשרויות לשימוש באטמל בתוך השדות
- $username=strip_tags($_POST['username']);
- $password=strip_tags($_POST['password']);
- $password2=strip_tags($_POST['password2']);
- $date=date("Y-m-d");
- // בודק אם הכניסו את כל השדות
- if($fullname == TRUE || $username == TRUE || $password == TRUE || $password2 == TRUE)
- {
- //מצפין את הסיסמא
- $password_m=md5($password);
- $password2_m=md5($password2);
- if ($password==$password2)
- {
- if (strlen($username)>25||strlen($fullname)>25)
- {
- echo "Max limit for Username / Fullname are 25 characters";
- }
- if (strlen($password_m) > 25 || strlen($password_m) < 6){
- echo "Password must be between 6 and 25 characters.";
- }
- else
- {
- echo "Your passwords do not match.";
- }
- }
- else
- {
- echo "Please fill in <b>all</b> fields!";
- }
- }
- }
- ?>
- <html>
- <form action="register.php" method="post">
- <table>
- <tr>
- <td>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>Confirm Password:</td>
- <td><input type='password' name='password2'/></td>
- </tr>
- </table>
- <p><input type='submit' name='submit' value='Register'/></p>
- </form>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement