forked from Kccorp/PA_2021_ESGI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcaptcha.php
107 lines (75 loc) · 2.17 KB
/
captcha.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
<?php
include "header.php";
//permet juste d'eviter d'acceder au captcha sans passer par login
if (!empty($_GET["login"])&&!empty($_GET["pwd"])) {
//permet de randomiser le set d'image utiliser entre 1, et X + indiquer son emplacement
$IT = "Images/captcha/".rand(1,3)."/";
//methode pour transferer l'emplacement des images utilisé au js
echo "<input id='rdm' type='hidden' value='".$IT."'>";
echo "
<div class='container'>
<div class='row'>
<div class='box shadow border col-md-4 p-3 my-5'>
<h1 class='text-green' style='font-family: Roboto' > PLAY </h1>
<h4 class='font-weight-bolder'> Captcha </h4>
<div class='row justify-content-center'>
<table id='captcha' BORDER=0 CELLSPACING=0 >
<style type='text/css'>
table {
border-collapse: collapse;
border-spacing: 0px;
}
</style>
<tr>
<td onclick=Swaps(1);>
<img id=1 src='".$IT."1.png' width='100',
height='auto'>
</td>
<td onclick=Swaps(2)>
<img id=2 src='".$IT."2.png' width='100',
height='auto'>
</td>
<td onclick=Swaps(3)>
<img id=3 src='".$IT."3.png' width='100',
height='auto'>
</td>
</tr>
<tr>
<td onclick=Swaps(4)>
<img id=4 src='".$IT."4.png' width='100',
height='auto'>
<td onclick=Swaps(5)>
<img id=5 src='".$IT."5.png' width='100',
height='auto'>
</td>
<td onclick=Swaps(6)>
<img id=6 src='".$IT."6.png' width='100',
height='auto'>
</td>
</tr>
<tr>
<td onclick=Swaps(7)>
<img id=7 src='".$IT."7.png' width='100',
height='auto'>
<td onclick=Swaps(8)>
<img id=8 src='".$IT."8.png' width='100',
height='auto'>
</td>
<td onclick=Swaps(9)>
<img id=9 src='".$IT."9.png' width='100',
height='auto'>
</td>
</tr>
</table>
</div>
<button onclick='verif()' class='btn btn-primary mt-2'>Valider</button>
<script onload='init()' src='CSS/bootstrap-4.6.0-dist/js/captcha.js'></script>
</div>
</div>
</div>";
}else {
header('Location: login.php');
session_destroy();
}
include "footer.php";
?>