Image verification in gastenboek ?
zoals velen kamp ik al een tijdje met spam bots in mijn gastenboek.
Ik had nu graag een image-verification er in gezet en dit is me gelukt,
alleen . . . .
er kan nog steeds een bericht geplaatst worden zonder dat het getal ingegeven wordt.
Kan iemand mij verklappen waar de fout zit ?
Ik heb de raad gekregen dat mijn $_POST variabelen ergens naartoe
moeten gaan maar dat dit niet in mijn script staat.
Maar aangezien ik een echte leek ben met php weet ik niet eens wat of waar ik iets zou moeten aanpassen
dit is een deel van het invul formulier (in php)
helemaal onderaan is het randomImage.php bestand te vinden.
Als iemand mij kan helpen om het intypen van het nummer verplicht te maken laat het me aub weten !!!
invulformulier:
Code (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
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
<?php
// ... the login script is up here
?>
<html>
<head>......
(rest van de site)
<?php
if ($errorMessage != '') {
?>
<p align="center"><strong><font color="#990000"><?php echo $errorMessage; ?></font></strong></p>
<?php
}
?>
<form name="invulform" method="POST" action="/cgi-bin/gastenboek.cgi?/nessler/gb/" onSubmit="return wordFilter('invulform',['Naam','Email','URL','Bericht']);">
<font face="Tahoma">
<INPUT NAME="required" TYPE="hidden" VALUE="Naam,Check">
<input type="hidden" name="OKurl" value="/nessler/gb/okurl.html">
</font>
<font face="Arial" size="-1">
<table>
<p align="left"><font color="#FFFFFF" size="2">Name</font><br>
</font>
<font face="verdana,arial,helvetica" size="-1">
<font face="Arial">
<input type="text" name="Naam" value="" size"30" size="24"></font><font face="Arial" size="-1">
<font color="#FFFFFF">(Required)</font>
</font>
<font face="Arial" size="-1">
<p align="left"><font color="#FFFFFF">E-mail</font><br>
</font>
<font face="verdana,arial,helvetica" size="-1">
<font face="Tahoma" size="-1">
<font face="Arial" color="#FFFFFF">
<input type="text" name="Email" value="@dummy.com" size="24"></font><font face="Arial" size="-1">
<font color="#FFFFFF">(Required)*</font>
</font>
<p align="left"><font color="#FFFFFF" face="Arial">Homepage<br>
</font><font face="Arial">
<input type="text" name="URL" value="" size"30" size="24"></font><font face="Arial" size="-1">
<font color="#FFFFFF">(Not required)<br>
<br>
Enter the numbers</font><br>
</font>
<font face="Arial" size="-1">
<font face="Arial">
<input name="txtNumber" type="text" id="txtNumber" value="" size="24"></font>
<img src="http://nessler.e-multimedia.co.uk/randomImage.php"><font color="#FFFFFF"> (Proove you're human)<br></font>
<br>
</font>
<font color="#FFFFFF"><font face="Arial">Bericht / Message</font><br>
<font color="#FFFFFF" face="Arial">
<textarea cols="61" rows="5" name="Bericht" style="font-family: Tahoma"></textarea></font><font size="-1"><font color="#FFFFFF" face="Tahoma">
</font>
</table>
<font face="Tahoma" size="-1">
<table cellspacing="5" celpadding="2" width="669">
<tr>
<td width="32" height="22"><img src="http://users.pandora.be/nessler/gb/angel.gif" alt="" onClick="addSmilie(':angel:');" width="15" height="20"></td>
<td width="34" height="22"><img src="http://users.pandora.be/nessler/gb/shame.gif" alt="" onClick="addSmilie('hame:');" width="15" height="15"></td>
<td width="33" height="22"><img src="http://users.pandora.be/nessler/gb/16_angry.gif" alt="" onClick="addSmilie(':angry:');" width="15" height="15"></td>
<td width="30" height="22"><img src="http://users.pandora.be/nessler/gb/beer.gif" alt="" onClick="addSmilie(':beer:');" width="29" height="15"></td>
<td width="49" height="22"><img src="http://users.pandora.be/nessler/gb/1_grin.gif" alt="" onClick="addSmilie(':grin:');" width="15" height="15"></td>
<td width="40" height="22"><img src="http://users.pandora.be/nessler/gb/2_smile.gif" alt="" onClick="addSmilie('mile:');" width="15" height="15"></td>
<td width="31" height="22"><img src="http://users.pandora.be/nessler/gb/8_grim.gif" alt="" onClick="addSmilie(':grim:');" width="15" height="15"></td>
<td width="51" height="22"><img src="http://users.pandora.be/nessler/gb/12_smile.gif" alt="" onClick="addSmilie('mile:');" width="15" height="15"></td>
<td width="34" height="22"><img src="http://users.pandora.be/nessler/gb/24_shocked.gif" alt="" onClick="addSmilie('hocked:');" width="15" height="15"></td>
<td width="26" height="22"><img src="http://users.pandora.be/nessler/gb/love.gif" alt="" onClick="addSmilie(':love:');" width="16" height="16"></td>
<td width="36" height="22"><img src="http://users.pandora.be/nessler/gb/happy2.gif" alt="" onClick="addSmilie(':happy2:');" width="15" height="15"></td>
</tr>
</td>
</table>
<font face="Tahoma">
<input type="submit" value="Submit Form" class="btn">
</font>
</form>
// ... the login script is up here
?>
<html>
<head>......
(rest van de site)
<?php
if ($errorMessage != '') {
?>
<p align="center"><strong><font color="#990000"><?php echo $errorMessage; ?></font></strong></p>
<?php
}
?>
<form name="invulform" method="POST" action="/cgi-bin/gastenboek.cgi?/nessler/gb/" onSubmit="return wordFilter('invulform',['Naam','Email','URL','Bericht']);">
<font face="Tahoma">
<INPUT NAME="required" TYPE="hidden" VALUE="Naam,Check">
<input type="hidden" name="OKurl" value="/nessler/gb/okurl.html">
</font>
<font face="Arial" size="-1">
<table>
<p align="left"><font color="#FFFFFF" size="2">Name</font><br>
</font>
<font face="verdana,arial,helvetica" size="-1">
<font face="Arial">
<input type="text" name="Naam" value="" size"30" size="24"></font><font face="Arial" size="-1">
<font color="#FFFFFF">(Required)</font>
</font>
<font face="Arial" size="-1">
<p align="left"><font color="#FFFFFF">E-mail</font><br>
</font>
<font face="verdana,arial,helvetica" size="-1">
<font face="Tahoma" size="-1">
<font face="Arial" color="#FFFFFF">
<input type="text" name="Email" value="@dummy.com" size="24"></font><font face="Arial" size="-1">
<font color="#FFFFFF">(Required)*</font>
</font>
<p align="left"><font color="#FFFFFF" face="Arial">Homepage<br>
</font><font face="Arial">
<input type="text" name="URL" value="" size"30" size="24"></font><font face="Arial" size="-1">
<font color="#FFFFFF">(Not required)<br>
<br>
Enter the numbers</font><br>
</font>
<font face="Arial" size="-1">
<font face="Arial">
<input name="txtNumber" type="text" id="txtNumber" value="" size="24"></font>
<img src="http://nessler.e-multimedia.co.uk/randomImage.php"><font color="#FFFFFF"> (Proove you're human)<br></font>
<br>
</font>
<font color="#FFFFFF"><font face="Arial">Bericht / Message</font><br>
<font color="#FFFFFF" face="Arial">
<textarea cols="61" rows="5" name="Bericht" style="font-family: Tahoma"></textarea></font><font size="-1"><font color="#FFFFFF" face="Tahoma">
</font>
</table>
<font face="Tahoma" size="-1">
<table cellspacing="5" celpadding="2" width="669">
<tr>
<td width="32" height="22"><img src="http://users.pandora.be/nessler/gb/angel.gif" alt="" onClick="addSmilie(':angel:');" width="15" height="20"></td>
<td width="34" height="22"><img src="http://users.pandora.be/nessler/gb/shame.gif" alt="" onClick="addSmilie('hame:');" width="15" height="15"></td>
<td width="33" height="22"><img src="http://users.pandora.be/nessler/gb/16_angry.gif" alt="" onClick="addSmilie(':angry:');" width="15" height="15"></td>
<td width="30" height="22"><img src="http://users.pandora.be/nessler/gb/beer.gif" alt="" onClick="addSmilie(':beer:');" width="29" height="15"></td>
<td width="49" height="22"><img src="http://users.pandora.be/nessler/gb/1_grin.gif" alt="" onClick="addSmilie(':grin:');" width="15" height="15"></td>
<td width="40" height="22"><img src="http://users.pandora.be/nessler/gb/2_smile.gif" alt="" onClick="addSmilie('mile:');" width="15" height="15"></td>
<td width="31" height="22"><img src="http://users.pandora.be/nessler/gb/8_grim.gif" alt="" onClick="addSmilie(':grim:');" width="15" height="15"></td>
<td width="51" height="22"><img src="http://users.pandora.be/nessler/gb/12_smile.gif" alt="" onClick="addSmilie('mile:');" width="15" height="15"></td>
<td width="34" height="22"><img src="http://users.pandora.be/nessler/gb/24_shocked.gif" alt="" onClick="addSmilie('hocked:');" width="15" height="15"></td>
<td width="26" height="22"><img src="http://users.pandora.be/nessler/gb/love.gif" alt="" onClick="addSmilie(':love:');" width="16" height="16"></td>
<td width="36" height="22"><img src="http://users.pandora.be/nessler/gb/happy2.gif" alt="" onClick="addSmilie(':happy2:');" width="15" height="15"></td>
</tr>
</td>
</table>
<font face="Tahoma">
<input type="submit" value="Submit Form" class="btn">
</font>
</form>
randomImage.php
Code (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
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
<?php
session_start();
// generate 5 digit random number
$rand = rand(10000, 99999);
// create the hash for the random number and put it in the session
$_SESSION['image_random_value'] = md5($rand);
// create the image
$image = imagecreate(60, 30);
// use white as the background image
$bgColor = imagecolorallocate ($image, 255, 255, 255);
// the text color is black
$textColor = imagecolorallocate ($image, 0, 0, 0);
// write the random number
imagestring ($image, 5, 5, 8, $rand, $textColor);
// send several headers to make sure the image is not cached
// taken directly from the PHP Manual
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// send the content type header so the image is displayed properly
header('Content-type: image/jpeg');
// send the image to the browser
imagejpeg($image);
// destroy the image to free up the memory
imagedestroy($image);
?>
session_start();
// generate 5 digit random number
$rand = rand(10000, 99999);
// create the hash for the random number and put it in the session
$_SESSION['image_random_value'] = md5($rand);
// create the image
$image = imagecreate(60, 30);
// use white as the background image
$bgColor = imagecolorallocate ($image, 255, 255, 255);
// the text color is black
$textColor = imagecolorallocate ($image, 0, 0, 0);
// write the random number
imagestring ($image, 5, 5, 8, $rand, $textColor);
// send several headers to make sure the image is not cached
// taken directly from the PHP Manual
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// send the content type header so the image is displayed properly
header('Content-type: image/jpeg');
// send the image to the browser
imagejpeg($image);
// destroy the image to free up the memory
imagedestroy($image);
?>
ALVAST BEDANKT !!!!
Gewijzigd op 01/01/1970 01:00:00 door Nick de baerdemaeker
Ik hoop dat je cgi kan. Anders is het niet mogelijk