-
Notifications
You must be signed in to change notification settings - Fork 0
/
verifyLogin.php
33 lines (31 loc) · 971 Bytes
/
verifyLogin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**********************************************************
* File: verifyLogin.php
* Author: James Richter
*
* Description: Automatically redirects the logged in
* user to the showPictures.php home page. Does a
* double check to make sure that the database loaded
* the right user.
***********************************************************/
if(isset($_POST['submit'])){
$_SESSION["user"] = $_POST['username'];
$_SESSION["password"] = $_POST['password'];
try {
loadDatabase($_SESSION["user"], $_SESSION["password"]);
$sql = 'SELECT * FROM picture';
header("Location: https://php-jamesrichter.rhcloud.com/showPictures.php");
die();
}
catch (Exception $ex){
echo 'Could not login.';
echo '
<form method="post" action="login.php" id="searchform">
Username<input type="text" name="username"><br/>
Password<input type="password" name="password">
<input type="submit" name="submit" value="Login">
</form>
';
}
}
?>