-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoginUser.php
58 lines (43 loc) · 1.08 KB
/
LoginUser.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
require_once("UserPDO.php");
require_once("User.php");
if(isset($_POST['submit']))
{
$username = $_POST["username"];
// echo $username . "<br>\n";
$password = $_POST["password"];
//echo $password ."<br>\n";
if($username !='' && $password !='')
{
$userPDO = new UserPDO();
$user = new User();
$user->setUserName($username);
$user->setPassword($password);
$loggedIn = $userPDO->checkUserExists($user);
echo("<html>");
echo("<head>");
echo("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' >");
echo("<link rel='stylesheet' type='text/css' href='menu.css'>");
echo("<title>News Portal -User Login</title>");
echo("</head>");
echo("<body>");
if($loggedIn)
{
include "menu.php";
echo("User LoggedIn </br>");
echo("Welcome to Nuntium Home");
}
else
{
echo("User Not LoggedIn </br>");
echo("<a href='index.php'> Go to Home</a>");
}
echo("</body>");
echo("</html");
}
else {
echo "Please fill all of the fields" . "<br>\n";
echo("<a href='index.php'> Go to Login Page</a>");
}
}
?>