Skip to content

Instantly share code, notes, and snippets.

@01-Scripts
Created August 4, 2014 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 01-Scripts/26a9e311c5a60db5aaff to your computer and use it in GitHub Desktop.
Save 01-Scripts/26a9e311c5a60db5aaff to your computer and use it in GitHub Desktop.
Just use the following secimg.php instead of the original one to get a captcha only with numbers.
<?PHP
session_start();
$secCode = rand(100000,999999);
$_SESSION['antispam_'.$_GET['formid']] = md5($secCode);
// get from: http://www.01-scripts.de/01scripts/01pics/sec.jpg
$im = imagecreatefromjpeg("sec.jpg");
// get from: http://www.01-scripts.de/01scripts/01pics/verdanab.ttf
$font = "verdanab.ttf";
$fontSize = 12;
$fontColor = imagecolorallocate($im, 70, 70, 70);
imagettftext($im, $fontSize, 10, 5, 25, $fontColor, $font, $secCode);
header("Content-Type: image/jpeg");
imagejpeg($im,NULL,100);
?>
@01-Scripts
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment