Web Analytics Made Easy -
StatCounter Captcha Image in PHP - CodingForum

Announcement

Collapse
No announcement yet.

Captcha Image in PHP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Captcha Image in PHP

    You can add Catcha Image in PHP forms, this is an example for PHP contact form:

    PHP Code:
    session_start();
    $random_alpha md5(rand());
    $captcha_code substr($random_alpha06);
    $_SESSION["captcha_code"] = $captcha_code;
    $target_layer imagecreatetruecolor(70,30);
    $captcha_background imagecolorallocate($target_layer255160119);
    imagefill($target_layer,0,0,$captcha_background);
    $captcha_text_color imagecolorallocate($target_layer000);
    imagestring($target_layer555$captcha_code$captcha_text_color);
    header("Content-type: image/jpeg");
    imagejpeg($target_layer); 
Working...
X