-
Notifications
You must be signed in to change notification settings - Fork 0
/
basic_auth2.php
120 lines (116 loc) · 3.5 KB
/
basic_auth2.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<html>
<head>
<title>Valfi Thread</title>
<script>
function validateForm()
{
var x = document.forms["auth"]["ide"].value;
if(x==null || x=="")
{
alert("Id field cannot be empty!");
return false;
}
x = document.forms["auth"]["pawd"].value;
if(x==null || x=="")
{
alert("Password field cannot be empty!");
return false;
}
}
function adddate()
{
var d=new Date();
var t=d.toLocaleDateString();
if(document.forms['valfi']['bulia'].value!="") document.forms['valfi']['bulia'].value+=" "+t;
if(document.forms['valfi']['pradyot'].value!="") document.forms['valfi']['pradyot'].value+=" "+t;
if(document.forms['valfi']['lokit'].value!="") document.forms['valfi']['lokit'].value+=" "+t;
if(document.forms['valfi']['malav'].value!="") document.forms['valfi']['malav'].value+=" "+t;
if(document.forms['valfi']['animax'].value!="") document.forms['valfi']['animax'].value+=" "+t;
if(document.forms['valfi']['chawal'].value!="") document.forms['valfi']['chawal'].value+=" "+t;
}
</script>
<style>
form {
background-position: center;
}
body {
background-color:black;
color:white;
background-image:
}
a {
padding-left:48%;
}
a:link {color:#BDA0CB;} /* unvisited link */
a:visited {color:#BDA0CB;} /* visited link */
a:hover {color:#FFFFFF;} /* mouse over link */
a:active {color:#0000FF;} /* selected link */
</style>
</head>
<body>
<p id="time" style="margin-left:46%;color:black;">YO</p>
<script>
var x = setInterval(function(){func()},1000);
function func()
{
document.getElementById("time").style.color="white";
var d=new Date();
var t=d.toLocaleDateString()+" "+d.toLocaleTimeString();
document.getElementById("time").innerHTML=t;
}
</script>
<?php
if($_SERVER['REQUEST_METHOD']==POST)
{
$i = ($_POST['ide']);
$p = ($_POST['pawd']);
$val = md5($i.$p);
$file = fopen("4dd77ecaf88620f5da8967bbd91d9506.txt",'r');
$flag = false;
while(!feof($file))
{
$x = chop(fgets($file));
if($x == $val)
{
$flag = true;
break;
}
}
fclose($file);
}
if($flag)
{
?>
<form method="POST" name="valfi" onsubmit="return adddate()" action="save.php">
Siddharth Bulia<br>
<textarea cols="40" rows="5" spellcheck="true" wrap="soft" name="bulia" autofocus="autofocus"></textarea><br>
Pradyot Prakash<br>
<textarea cols="40" rows="5" spellcheck="true" wrap="soft" name="pradyot" autofocus="autofocus"></textarea><br>
Lokit Kumar Paras<br>
<textarea cols="40" rows="5" spellcheck="true" wrap="soft" name="lokit" autofocus="autofocus"></textarea><br>
Amit Malav<br>
<textarea cols="40" rows="5" spellcheck="true" wrap="soft" name="malav" autofocus="autofocus"></textarea><br>
Animesh Baranwal<br>
<textarea cols="40" rows="5" spellcheck="true" wrap="soft" name="animax" autofocus="autofocus"></textarea><br>
Rawal Khirodkar<br>
<textarea cols="40" rows="5" spellcheck="true" wrap="soft" name="chawal" autofocus="autofocus"></textarea><br>
<input type="submit"><br>
</form>
<?php
}
else
{
if($_SERVER['REQUEST_METHOD']=="POST")
echo '<span style="margin-left:40%;">Incorrect credentials! Try again.</span><br>';
echo '<br><br><br><br>
<form name="auth" onsubmit="return validateForm()" method="POST" action="basic_auth2.php">
<span style="margin-left:45%;"><input autofocus placeholder="Id" name="ide" type="name"></span><br>
<span style="margin-left:45%;"><input placeholder="Password" name="pawd" type="password"></span><br>
<span style="margin-left:50%;"><input type="submit" class="submit"></span>
</form>
<a href="pwd.php">Change Password</a>
';
}
?>
</body>
</html>