This is for a security code (captcah).
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
Moderator: General Moderators
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
Code: Select all
imageline($image, $startx, $starty, $endx, $endy, $color);Code: Select all
//create your image
$image = imagecreatefrompng($path); or imagecreatefrombmp($path) or imagecreatefromjpeg($path);
//get your random data
$width = imagesx($image);
$height = imagesy($image);
$startx = rand(0,$width-1);
$starty = rand(0,$height-1);
$endx = rand(0,$width-1);
$endy = rand(0, $height-1);
//if you want black color:
$color = imagecolorallocate($image, 0, 0, 0);
//draw the random line
imageline($image, $startx, $starty, $endx, $endy, $color);
//output the image
imagepng($image); or imagebmp($image); or imagejpeg($image);
//free memory
imagedestroy($image);