-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdscvalidation.php
67 lines (57 loc) · 2.46 KB
/
dscvalidation.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
<html>
<head>
<title>validate</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="public/css/bootstrap.min.css">
<script src="public/js/jquery.min.js"></script>
<script src="public/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class='row' align='right' style='padding-top: 20px;'>
<a href='logout.php' class='button'><button type='submit' class='btn btn-warning' id='dsc' name='dsc'> Logout </button></a>
</div>
<div class="row" align="center" style="padding-top: 100px;">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-sm-2"></div>
<div class="col-sm-8">
<?php
if(isset($_COOKIE['session_cookie']))
{
session_start();
if ($_POST['csrf_Token'] == $_COOKIE['csrf_token'])
{
$name=$_POST['name'];
$dob=$_POST['dob'];
$address=$_POST['address'];
$age=$_POST['age'];
echo "<div class='alert alert-warning' role='alert'>"."You are free of CSRF"."</div>";
echo "<div class='alert alert-success' role='alert'>".$name."</div>";
echo "<div class='alert alert-info' role='alert'>".$dob."</div>";
echo "<div class='alert alert-success' role='alert'>".$address."</div>";
echo "<div class='alert alert-info' role='alert'>".$age."</div>";
//echo "<script>alert('not Found !!!')</script>";
}
else
{
echo "<script>alert('WARNING :: CSRF Found !!!')</script>";
}
}
else{
echo "<h3>Couldn't set session correctly. Try login again!!!</h3><br><a href='dsclogin.php' class='button'><button type='submit' class='btn btn-warning' id='dsc' name='dsc'> Login </button></a>";
}
?>
</div>
<div class="col-sm-2"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>