-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.php
More file actions
27 lines (25 loc) · 721 Bytes
/
test.php
File metadata and controls
27 lines (25 loc) · 721 Bytes
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
<?php
/*
* PHP Lib Block CSRF Attempt.
* ********************************
* Test File.
* ********************************
*/
require_once('CSRF.php');
$CSRF = new CSRF();
if(isset($_POST['submit']))
echo $CSRF->checkToken($_POST['token']) ? /* Request accepted */ "Validate token." : /* Request denied */ "Bad token.";
?>
<DOCTYPE html>
<html lang="en" xmlns="//www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>Test File</title>
</head>
<body style="text-align: center;">
<form method="POST">
<input type="text" name="token" value="<?php echo $CSRF->getToken(); ?>"/>
<input type="submit" name="submit" value="Check"/>
</form>
</body>
</html>