-
Notifications
You must be signed in to change notification settings - Fork 1
/
upload.php
executable file
·49 lines (48 loc) · 1.36 KB
/
upload.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
<?php
ob_start();
session_start();
include "header.php";
?>
<?php
$postusername = htmlentities($_POST['username']);
$postpassword = htmlentities(md5($_POST['password']));
settype($postusername, "string");
settype($postpassword, "string");
$file = "./users/$postusername/username";
if (!$postusername || !$postpassword) {
$loginstatus = "";
}
else {
if (file_exists($file)) {
require_once"logininfo.php";
if (isset($postusername, $postpassword)) {
if ($username == $postusername && $password == $postpassword) {
$_SESSION['username'] = $username;
header("Location: ./choseimg.php");
} else {
$loginstatus = "<p class=\"loginStatus\">Incorrect username and/or password.</p>";
}
}
} else {
$loginstatus = "<p class=\"loginStatus\">Incorrect username and/or password.</p>";
}
}
?>
<body>
<?php echo "$loginstatus"; ?>
<div id="conholder">
<div id="loginbox">
<div id="front">
<h1 class="texth1">Login</h1>
<form class="adform" method="POST" action="upload.php">
<input class="adinput" type="text" name="username" placeholder="Username">
<input class="adinput" type="password" name="password" placeholder="Password"></ br></ br/>
<input type="hidden" name="usernameHidden" value="<?php echo $postusername; ?>">
<input class="adsubmit" type="submit" value="Login">
</form>
</div>
</div>
</div>
<?php
include "footer.php";
?>