3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (!isset($_SESSION[' isLogged ']) == true) { if ($_POST) { $username = trim($_POST['username']); $pass = trim($_POST['pass']) ; $pass2 = trim($_POST['pass2']); $email = trim($_POST['email']); $error_array=array(); if (strlen($username) < 5) { $error_array['username'] = 'Кратко име.Трябва да е поне 4 синвола!'; } if (strlen($pass) < 4) { $error_array['pass'] = 'Кратка парола!'; } if ($pass != $pass2) { $error_array['pass2'] = 'Паролите не въпадат!'; } if (!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $email)) { $error_array['email'] = 'Невалиден Email адрес!'; } if (!preg_match("/^[a-zA-Z0-9_]{5,16}$/", $username)) { $error_array['username'] = 'Невалидно име!'; } if (!isset($error_array) > 0) { $query->query($dbconnect, 'SELECT * FROM users WHERE user_name="'.$username.'" AND user_mail="'.$email.'"'); if ($query->num_rows) { echo '<center><b><h1>Username or Email is busy.Please try again!</h1></b></center>'; header("refresh:2;url=register.php"); exit; } else { mysqli_query($dbconnect, 'INSERT INTO users (user_name,user_pass,user_mail) VALUES("' . addslashes($username) . '","' . addslashes($pass) . '","' . addslashes($email) . '")'); echo '<center><h1><b>Registered is success!</b></h1></center>'; header("refresh:2;url=index.php"); exit; } } else { echo '<center><h1><b>All fields are required!</b></h1></center>'; } } else { echo '<center><h1><b>Registered is not complete!</b></h1></center>'; } } else { echo '<center><h1><b>Вече сте влезли в системата!</h1></b></center>'; header("refresh:2;url=index.php"); exit; }
Output for 4.3.0 - 7.1.0
<center><h1><b>Registered is not complete!</b></h1></center>