Hallo,

in men gastenboek wordt ik al geruime tijd gespamd door spambots die altijd links zetten naar p**nsite's en andere. Hoe kan je het best je tegen deze spambots beveiligen, want ik heb nu een IP ban op men GB maar dit helpt niet.

Weten jullie een goede manier?

Grtzz Pieter
Google: [google]captcha[/google]

Arjan had in zijn nieuwssysteem trouwens ook een hele mooie oplossing: Stel een vraag waar mensen geen probleem mee hebben, maar dingen zonder kennis afschrikt.

'Wat is de hoofdstad van Nederland?' _________________

Geen enkele spambot die weet wat hij daar mee aanmoet.
Ja die captcha ga ik misschien gebruiken.

Maar zo'n vraag vind ik vervelend omdat er sommige mensen zijn die het antwoord nie zouden weten.

Grtzz Pieter
Pieter schreef op 30.05.2006 19:28
Ja die captcha ga ik misschien gebruiken.

Maar zo'n vraag vind ik vervelend omdat er sommige mensen zijn die het antwoord nie zouden weten.

Grtzz Pieter


Kwestie van goede vraag verzinnen.
Ik heb zelf: Hoeveel letters zitten er in het alfabet.
Met als keuze: 1, 26 of 2
Ik denk zelfs dat je zo'n vraag niet eens meerkeuze hoeft te maken. Maar dat is natuurlijk eigen keuze.
@ Jelmer: Groningen
Eventueel zou je met javascript alvast het goede antwoord in kunnen vullen. Bots hebben over het algemeen ook geen javascript.
dan vraagje: weet je zeker da je dit wil posten? [ja] [nee]
gaat dat ook?


dan vraagje: weet je zeker da je dit wil posten? [ja] [nee]

want ik weet niet hoe spambots werken.

Grtzz Pieter
Dit is een aardig CAPTCHA script:
captcha.php

<html>
<head>
<title>Captcha Test!</title>
</head>
<body>
<form action="captcha_test.php" method="post">
	<table class="bigone">
		<tr>
			<td align="center">
				A message:
			</td>
			<td align="center">
				<input type="text" maxlength="16" name="message" size="15">
			</td>
		</tr>
		<tr>
			<td align="center">
				what text do you see<br />
				in the black box <br />
				<img src="captcha_image.php" />:
			</td>
			<td align="center">
				<input type="text" name="captcha_input" size="15">
			</td>
		</tr>

		<tr>
			<td align="center" colspan="2">
				<input type="submit" id="scratch_submit" value="Post Message">
			</td>
		</tr>
	</table>
</form>
</body>
</html>


captch_image.php

<?php
// *** CAPTCHA image generation ***
// *** http://frikk.tk ***

session_start();

// *** Tell the browser what kind of file is come'n at 'em! ***
header("Content-Type: image/jpeg");

// *** Send a generated image to the browser ***
create_image();
die();

// *** Function List ***
function create_image()
{
	// *** Generate a passcode using md5
	//	(it will be all lowercase hex letters and numbers ***
	$md5 = md5(rand(0,9999));
	$pass = substr($md5, 10, 5);
	
	// *** Set the session cookie so we know what the passcode is ***
	$_SESSION["pass"] = $pass;
	
	// *** Create the image resource ***
	$image = ImageCreatetruecolor(100, 20);  

	// *** We are making two colors, white and black ***
	$clr_white = ImageColorAllocate($image, 255, 255, 255);
	$clr_black = ImageColorAllocate($image, 0, 0, 0);

	// *** Make the background black ***
	imagefill($image, 0, 0, $clr_black);

	// *** Set the image height and width ***
	imagefontheight(15);
	imagefontwidth(15);

	// *** Add the passcode in white to the image ***
	imagestring($image, 5, 30, 3, $pass, $clr_white);
	
	// *** Throw in some lines to trick those cheeky bots! ***
	imageline($image, 5, 1, 50, 20, $clr_white);
	imageline($image, 60, 1, 96, 20, $clr_white);

	// *** Output the newly created image in jpeg format ***
	imagejpeg($image);
	
	// *** Clear up some memory... ***
	imagedestroy($image);
}
?>


captcha_test.php

<?php
// *** The CAPTCHA comparison - http://frikk.tk ***
session_start();

// *** We need to make sure theyre coming from a posted form -
//	If not, quit now ***
if ($_SERVER["REQUEST_METHOD"] <> "POST")
	die("You can only reach this page by posting from the <a href=\"captcha.php\">html form</a>");

// *** The text input will come in through the variable $_POST["captcha_input"],
//	while the correct answer is stored in the cookie $_COOKIE["pass"] ***
if ($_POST["captcha_input"] == $_SESSION["pass"])
{
	// *** They passed the test! ***
	// *** This is where you would post a comment to your database, etc ***
	echo "Correct! Youve passed the captcha test. <br><br>";
	echo "Your Message: \"" . $_POST["message"] . "\" would be posted if ";
	echo "this example was fully functional";
} else {
	// *** The input text did not match the stored text, so they failed ***
	// *** You would probably not want to include the correct answer, but
	//	unless someone is trying on purpose to circumvent you specifically,
	//	its not a big deal.  If someone is trying to circumvent you, then
	//	you should probably use a more secure way besides storing the
	//	info in a cookie that always has the same name! :) ***
	echo "Sorry, you did not pass the CAPTCHA test.<br><br>";
	echo "You said " . $_POST["captcha_input"];
	echo " while the correct answer was " . $_SESSION["pass"];
}
?>
Thanks, ik zal het proberen, maar het zal nog een tijdje duren want ik heb binnenkort examens. Dusja, van 12 tot 23 juni heb ik examens. Dan kan ik niet op de pc komen.

Grtzz Pieter
Hallo,
Ik ben het een beetje aan het testen.
Maar ik krijg geen afbeelding.
Hoe komt dit?
http://kljzaffelare.kl.funpic.de/include/captcha.php

Grtzz Pieter

[edit]
Nee srr ik had een typfout gemaakt. En ik had erover gekeken.
Ps ik zat efjes op WC daarmee dat ik niet kon antwoorden.

Bedankt voor de reacties
[/edit]

Reageren