Fixes and cleanup

This commit is contained in:
William Miceli
2019-12-03 22:53:52 -05:00
parent 393b9e8725
commit e93827e46f
3 changed files with 7 additions and 26 deletions

View File

@@ -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>

View File

@@ -16,15 +16,14 @@
// 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
if(!empty($_POST)){
$_SESSION["loginError"] = "Username and Password are required, please try again"; $_SESSION["loginError"] = "Username and Password are required, please try again";
// header("Location: /login.php"); }
} }
}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

View File

@@ -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>