-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
35 lines (26 loc) · 769 Bytes
/
example.php
File metadata and controls
35 lines (26 loc) · 769 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
28
29
30
31
32
33
34
35
<?php
// Session start is needed
session_start();
if (isset($_POST['submit'])) {
// Check for valid CSRF code
require('inc/csrf_check.php');
// Check for Captcha string
if (require('inc/captcha_check.php')) {
echo 'Everything correct<br>';
echo '<input type="button" value="Run Again"
onClick="window.location.href=\'\'">';
exit();
}else{
echo 'Captcha wrong<br>';
}
}
?>
<form method="post">
<!-- Generate CSRF protection code -->
<?php require('inc/csrf_create.php') ?>
<!-- Generate Captcha image -->
<img src="inc/captcha_img.php" style="border: 1px solid black"><br>
<!-- Input Captcha characters -->
<?php require('inc/captcha_input.php') ?>
<input type="submit" name="submit">
</form>