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 =strip_tags($_POST['password']);
- $repeatpassword = strip_tags($_POST['repeatpassword']);
- $date = ("Y-m-d");
- if ($submit) {
- // Check to see if they are in database already
- if($fullname&&$username&&$$$password&&$repeatpassword) {
- $password = md5($password);
- $repeatpassword = md5($repeatpassword);
- if ($password==$repeatpassword) {
- // check char lenght of username and fullname
- if (strlen($username)>25||strlen($fullname)>25)
- {
- echo "Full name or Username is too long!";
- }
- else
- {
- // check lenght of password
- if (strlen($password)>25||strlen($password)<8)
- {
- echo "Password <strong>Must</strong> be between 8 and 25 characters";
- }
- else {
- // Register Users
- }
- }
- }
- else
- echo "Your password don't match!";
- }
- else
- echo "Please fill in <strong>all</strong> fields.";
- }
- ?>
- <!DOCTYPE html>
- <html lang="">
- <head>
- <meta charset="utf-8">
- <title></title>
- <meta name="description" content="" />
- <meta name="keywords" content="" />
- <meta name="robots" content="" />
- </head>
- <body>
- <form action='register.php' method='post'>
- <label>Full Name</label><input type='text' name='fullname'>
- <label>Choose Username</label><input type='text' name='username'>
- <label>Choose Password</label><input type='password' name='password'>
- <label>Repeat Password</label><input type='password' name='repeatpassword'>
- <input type='submit' name='submit' value='Register'>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment