-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
39 lines (33 loc) · 1.23 KB
/
index.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
34
35
36
37
38
39
<html>
<head>
<title>Database Auth</title>
</head>
<?php
session_start();
if (isset($_POST['login'])) {
$_SESSION['username'] = $_POST['input_user'];
$_SESSION['password'] = $_POST['input_pass'];
$user = $_SESSION['username'];
$password = $_SESSION['password'];
$_SESSION['conn_string'] = "host=web0.eecs.uottawa.ca port=15432 dbname=group_b02_g05 user=$user password=$password";
header('Location: login.php');
exit();
}
?>
<body>
<p>Input details for uOttawa database authentication (web0.eecs.uottawa.ca)</p>
<form id="testform" name="testform" method="post" action="">
<p>
<label for="user">Enter your username:</label>
<input name="input_user" type="text" id="input_user" required/><br/>
</p>
<p>
<label for="pass">Enter your password:</label>
<input name="input_pass" type="password" id="input_pass" required/><br/>
</p>
<p>
<input type="submit" name="login" value="Login" id="login"/><br/><br/>
</p>
</form>
</body>
</html>