-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
87 lines (70 loc) · 3.2 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
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
80
81
82
83
84
85
86
87
<?php
session_start();
include("config.php");
?>
<?php
if(isset($_POST["submit"]))
{
global $con;
$uname= $_POST["uname"];
$upass= $_POST["upass"];
$query = $con->prepare("SELECT * FROM users WHERE uname = :username and upass = :userpass");
$query-> bindParam(':username', $uname, PDO::PARAM_STR);
$query-> bindParam(':userpass', $upass, PDO::PARAM_STR);
$query-> execute();
if( $results = $query -> fetch(PDO::FETCH_ASSOC) ){
$_SESSION["uid"]=$results["uid"];
$_SESSION["uname"]=$results["uname"];
header("location:dashboard.php");
}else{
echo "<script>alert('Invalid Detail');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/png" href="assets/images/privacy.svg"/>
<title>MOODLE</title>
<meta name="description" content="Search the web for sites and images.">
<meta name="keywords" content="Search engine, doodle, websites">
<meta name="author" content="Reece Kenney">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="wrapper indexPage container">
<div class="mainSection">
<div class="logoContainer">
<img src="assets/images/moodleLogo.png" title="Private and Anonymous Search Engine" alt="Logo">
</div>
<div class="searchContainer" style="text-align: center;width: 420px;">
<h2>Login Portal</h2> <br>
<form action="/" method="POST" autocomplete="off">
<input type="text" class="searchBox" placeholder="Enter Name" name="uname"><br>
<input type="password" class="searchBox" placeholder="Enter Password" name="upass">
<input class="searchButton" type="submit" name="submit" value="Log In">
</form>
</div>
<div class="privacyContainer">
<div class="image">
<img src="assets/images/privacy.svg" title="Private and Anonymous Search Engine" alt="Logo">
</div>
<div class="description">
<small>This is a</small><h1>Anonymous Window</h1>
<p>
Moodle doesn't remember what you do in a Private Window.
Sites you visit won't show up in your history, and cookies vanish when you're done.
Private Windows don't make you completely anonymous online, though.
<a href="#">Learn more</a>
</p>
</div>
</div>
</div>
</div>
</body>
</html>