-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.php
More file actions
79 lines (57 loc) · 1.43 KB
/
user.php
File metadata and controls
79 lines (57 loc) · 1.43 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<head>
<link rel="stylesheet" href="projectstyle.css" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Maven Pro' rel='stylesheet'>
</head>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "project";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (mysqli_connect_errno()) {
echo "Failed to connect to database.";
}
if(isset($_POST['Login!']))
{
$myemail = $_POST['email'];
$mypass = $_POST['pass'];
$sql="SELECT * FROM accounts WHERE email='$myemail' and pass = '$mypass'";
$result=mysqli_query($conn,$sql);
$count = mysqli_num_rows($result);
if ($count) {
if(isset($_POST['remember']))
{
setcookie('email',$email,time()+60+60+7);
setcookie('pass',$pass,time()+60+60+7);
}
session_start();
$_SESSION['email'] = $myemail;
header("Location:dashboard.php");
}
else {
echo "unsuccessful";
}
}
?>
<body class = "login">
<head>
<div class = "top">
<div id = "top1">
<h1>Admin Management System</h1>
</div>
<div id = "top2">
<h3>Welcome!</h3>
</div>
</div>
</head>
<div class = "navigation">
<ul id="menu" style = "opacity:0.7; background:#000;">
<li style = "float:right;"><a href="new_contact.php">Contact Us</a></li>
<li style = "float:right;"><a href="current_events.php">Events</a></li>
<li style = "float:right;"><a href="current_pages.php">Pages</a></li>
</ul>
</div>
</body>
<?php
include('footer.php');
?>