View difference between Paste ID: 6Df54zJ7 and ZegVGbz7
SHOW: | | - or go back to the newest paste.
1-
        if(isset($_POST['username'])) {       
1+
if(isset($_POST['username'])) {       
2-
                if(strlen($_POST['username']) >= 3 && strlen($_POST['password']) >= 6) {
2+
        if(strlen($_POST['username']) >= 3 && strlen($_POST['password']) >= 6) {
3-
                        $logged_user = $user_api->login($_POST['username'], $_POST['password']);
3+
                $logged_user = $user_api->login($_POST['username'], $_POST['password']);
4-
                        echo "<h1>IT WORKED! Welcome back to Clementeene {$_POST['username']}</h1> <a href='index.php'>Go play!</a>";
4+
                echo "<h1>IT WORKED! Welcome back to Clementeene {$_POST['username']}</h1> <a href='index.php'>Go play!</a>";
5
6-
                        echo "<a href='usercp.php'>Go to control panel</a>";
6+
                echo "<a href='usercp.php'>Go to control panel</a>";
7
8-
                        $_SESSION["logged_in"] = true;
8+
                $_SESSION["logged_in"] = true;
9-
                        $_SESSION["username"] = $logged_user['username'];
9+
                $_SESSION["username"] = $logged_user['username'];
10-
                        $_SESSION["user_id"] = $logged_user['id'];
10+
                $_SESSION["user_id"] = $logged_user['id'];
11-
                
11+
12-
                if($logged_user == false) {
12+
        if($logged_user == false) {
13-
                        echo "Wrong username or password. Or username or password length wrong";
13+
                echo "Wrong username or password. Or username or password length wrong";
14-
                        }
14+
15
        }
16
17
18-
                else {
18+
        else {
19-
                        echo "Username and/or password too short.";
19+
                echo "Username and/or password too short.";
20-
                        }
20+
21-
                }
21+
        }