30) { echo 'Please ahear to maxlength of fields'; } else { if ($password != $password_again) { echo 'Passwords do not match'; }elseif (strlen($password) < 6){ echo 'Password is weak!'; } else { $query = "SELECT `email` FROM `globaly_accounts` WHERE `email` ='$email'"; $query_run = mysqli_query($con, $query); if (mysqli_num_rows($query_run) == 1) { echo 'The email ' . $email . 'already exists'; } else { $query = "INSERT INTO `globaly_accounts` VALUES (NULL ,'" . mysqli_real_escape_string($con, $name) . "','" . mysqli_real_escape_string($con, $email) . "','" . mysqli_real_escape_string($con, $password_hash) . "')"; if ($query_run = mysqli_query($con, $query)) { echo ''; header('Location: ../index.html'); } else { echo 'We could not register you!'; } } } } } else { echo 'All fields are required'; } } } else if (loggedin()) { echo 'You are already registered and logged in !'; }