Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = $_POST['username'];
- $email = $_POST['email'];
- $location = $_POST['location'];
- ?>
- <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
- Username:
- <input type="text" name="username" value="<?php echo $username; ?>" />
- <br>
- Email:
- <input type="text" name="email" value="<?php echo $email; ?>" />
- <br>
- Password:
- <input type="password" name="password1" />
- <br>
- Password(again):
- <input type="password" name="password2" />
- <br>
- Location:
- <input type="text" name="location" value="<?php echo $location; ?>" />
- <br />
- <?php
- $ip=$_SERVER['REMOTE_ADDR'];
- ?>
- Ip: <strong><?php echo "$ip" ?></strong><br />
- <br />
- <input name="terms" type="checkbox">
- I agree the Terms and Conditions <br />
- <br />
- <input type="submit" name="submit" value="Register!" />
- </form>
- <?php
- $username = $_POST['username'];
- $email = $_POST['email'];
- $password1 = $_POST['password1'];
- $password2 = $_POST['password2'];
- $location = $_POST['location'];
- $terms = $_POST['terms'];
- $namelength = strlen($username);
- if(isset($_POST['username']) && $namelength > 3)
- {
- if($password1 != $password2)
- {
- echo "Your passwords do not match!";
- }
- elseif($terms != on)
- {
- echo "You must agree before you can continue!";
- }
- }
- elseif($namelength <= 3 && $namelength >= 1)
- {
- echo "Your Username must be longer than 3 characters!";
- }
- ?>
Add Comment
Please, Sign In to add comment