/ Published in: PHP
This produces a JPG image with a calculation for spam-prevention. (with german written numbers) An alternative to captcha images.
Expand |
Embed | Plain Text
<?php $words = array("[eins]","[zwei]","[drei]","[vier]","[fünf]","[sechs]","[sieben]","[acht]","[neun]"); $plus = "+"; $ergebnis = $num[$first] + $num[$second]; $showcode = $words[$first] . " + " . $words[$second] . " = "; $_SESSION['mmmath'] = $ergebnis; #echo $showcode; #echo $ergebnis; $height = 20; #$width = 225; $image = @imagecreate($width,$height); imagecolorallocate($image, 238, 238, 238); $text_color = imagecolorallocate($image, 0, 0, 0); imagestring($image, 4, 2, 2, $showcode, $text_color); #$bordercolor = imagecolorallocate($image, 80, 80, 80); #imagerectangle($image,0,0,$width-1,$height-1,$bordercolor); imagejpeg($image); ?>
You need to login to post a comment.
