Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST["username"])) {
- $username = $_POST["username"];
- } else {
- die("Hacking attempt detected. Nice try!");
- }
- if(isset($_POST["password"])) {
- $password = $_POST["password"];
- } else {
- die("Hacking attempt detected. Nice try!");
- }
- if(isset($_POST["confirm_password"])) {
- $confirm_password = $_POST["confirm_password"];
- } else {
- die("Hacking attempt detected. Nice try!");
- }
- if(isset($_POST["email"])) {
- $email = $_POST["email"];
- } else {
- die("Hacking attempt detected. Nice try!");
- }
- if(isset($_POST["name"])) {
- $name = $_POST["name"];
- } else {
- die("Hacking attempt detected. Nice try!");
- }
- $errors = array();
- if(!(strlen($username)>=3 && strlen($username)<=30)) {
- $errors[] = "Error: The username should be between 3 and 30 characters.";
- }
- if(!(strlen($password)>=6 && strlen($password)<=30)) {
- $errors[] = "Error: The password should be between 6 and 30 characters.";
- }
- if($password!=$confirm_password) {
- $errors[] = "Error: The passwords do not match!";
- }
- if(count($errors)>0) {
- foreach($errors as $error) {
- echo $error."<br>";
- }
- } else {
- echo "OK";
- }
- ?>
Add Comment
Please, Sign In to add comment