Fixes and cleanup
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<?php
|
||||
try{
|
||||
echo '<pre>';
|
||||
// echo "messageID\tdate\t\tsender\trecipient\tmessage\n\n";
|
||||
echo "Friends:\n\n";
|
||||
$sql_select = "SELECT friend";
|
||||
$sql_from = "FROM friendList";
|
||||
$sql_where = "WHERE username='".$_SESSION["loggedInUser"]."' AND confirm=true";
|
||||
@@ -30,12 +30,6 @@
|
||||
}catch(Exception $e){
|
||||
echo "Exception: ".$e->getMessage().PHP_EOL;
|
||||
}
|
||||
|
||||
echo '<h3>$GLOBALS</h3>';
|
||||
echo '<pre>';
|
||||
print_r($GLOBALS);
|
||||
echo '</pre>';
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,17 +14,16 @@
|
||||
$_SESSION['loggedInUser'] = $_POST['login_username'];
|
||||
unset($_SESSION['loginError']);
|
||||
// Move onto landing page
|
||||
// header('Location: /landingPage.html');
|
||||
// header('Location: /landingPage.html');
|
||||
}else{
|
||||
// No matching users found, send user error
|
||||
// No matching users found, send user an error message
|
||||
$_SESSION['loginError'] = 'Invalid Username or Password';
|
||||
// Return to login page
|
||||
// header("Location: /login.php");
|
||||
}
|
||||
}else{
|
||||
// Return to login page, as credentials were not captured
|
||||
$_SESSION["loginError"] = "Username and Password are required, please try again";
|
||||
// header("Location: /login.php");
|
||||
// If user submitted login form wihout actually filling it out completely, send user an error message
|
||||
if(!empty($_POST)){
|
||||
$_SESSION["loginError"] = "Username and Password are required, please try again";
|
||||
}
|
||||
}
|
||||
}catch(PDOException $e){
|
||||
echo "PDOException: ".$e->getMessage();
|
||||
@@ -53,12 +52,6 @@
|
||||
<input type="password" name="login_password" placeholder="Password"><br />
|
||||
<input type="submit">
|
||||
</form>
|
||||
<?php
|
||||
echo '<h3>$GLOBALS</h3>';
|
||||
echo '<pre>';
|
||||
print_r($GLOBALS);
|
||||
echo '</pre>';
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
@@ -34,12 +34,6 @@
|
||||
}catch(Exception $e){
|
||||
echo "Exception: ".$e->getMessage().PHP_EOL;
|
||||
}
|
||||
/*
|
||||
echo '<h3>$GLOBALS</h3>';
|
||||
echo '<pre>';
|
||||
print_r($GLOBALS);
|
||||
echo '</pre>';
|
||||
*/
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user