-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
60 lines (54 loc) · 1.77 KB
/
index.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
<?php
if(session_id() == '' || !isset($_SESSION)){session_start();}
if (isset($_SESSION["username"])) {header ("location:loginregist.php");}
?>
<!doctype html>
<html>
<head>
<title>Captcha</title>
<link rel="stylesheet" href="css/captcha.css">
</head>
<body>
<div class="robotcheck">
<div>
<div>
<center><h3><b>Robot Checking Captcha</b></h3></center>
<center><p>Fill the captcha below to see if you're robot or human</p></center>
<br>
</div>
</div>
<div>
<div>
<?php
if(isset($_POST["captcha"]) && $_POST["captcha"] != "" && $_SESSION["ttcapt"] == $_POST["captcha"])
{
header ("location:loginregist.php");
}
else {
if(isset($_POST["captcha"]) && $_POST["captcha"] != "" && $_SESSION["ttcapt"] != $_POST["captcha"])
{
echo "<script>
alert('Wrong captcha');
</script>";
}
?>
</div>
<div>
<div>
<div>
<form action="" method="post">
<center><img id="tt_capimage" src="captcha.php" /></center>
<center><input class="input" id="tt_capvalue" name="captcha" type="text"/></center>
<center><button name="submit" type="submit" id="tt_capsubmit" class="btn">SUBMIT</button></center>
<center><button onclick="window.location=loginregist.php" class="btn">CHANGE CHAPTA</button></center>
</form>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>