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