Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['submit']))
- {
- $username = mysqli_real_escape_string($mysqli->connection,$_POST['username']);
- $password = mysqli_real_escape_string($mysqli->connection,$_POST['password']);
- $md5Pass = md5($password);
- if (empty($username) || empty($password)) {
- echo "Please fill in all required fields";
- } elseif (!$v->isSecure($username) || !$v->isSecure($password)) {
- echo "Your submitted data is either invalid or insecure please check your data and try again later<br>";
- } elseif ($v->checkMinLength($username, 5)) {
- echo "Username is shorter than five characters<br>";
- } elseif ($v->checkMinLength($password, 6)) {
- echo "Password is shorter than six characters.<br>";
- } elseif ($v->checkMaxLength($username, 32)) {
- echo "Username is longer than 32 characters please shorten it<br>";
- } elseif ($v->checkMaxLength($password,32)) {
- echo "Password is longer than 32 characters plaease shorten it<br>";
- } elseif (!$user->userExists($username)) {
- echo "Invalid username / password provided<br>";
- } elseif (!$user->VerifyUserPassword($username,$md5Pass)) {
- echo "Invalid username / password provided<br>";
- } else {
- if(!$user->IsAdmin($username)) {
- echo "Invalid username / password provided";
- } else {
- $functions->RegisterLogin($username);
- $functions->redirect("index.php");
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement