CREATE IMAGE IN PHP for catpcha
<?php
$width=150;
$height=50;
//image frame create
$image_frame = imagecreate($width, $height);
$r1= 255;
$g1= 196;
$b1= 0;
imagecolorallocate($image_frame,$r1,$g1,$b1);
$r2= 231;
$g2= 219;
$b2= 96;
imagecolorallocate($image_frame,$r2, $g2,$b2);
header("Content-Type:image/jpeg");
imagejpeg($image_frame);
?>
<?php
$width=150;
$height=50;
//image frame create --background color
$image_frame = imagecreate($width, $height);
$r1= 255;
$g1= 196;
$b1= 0;
imagecolorallocate($image_frame,$r1,$g1,$b1);
$r2= 231;
$g2= 219;
$b2= 96;
imagecolorallocate($image_frame,$r2, $g2,$b2);
header("Content-Type:image/jpeg");
imagejpeg($image_frame,"capcha.jpg",100);
// if you are writeing to file free memory
//imagedestroy($image_frame);
?>
0 Comments