Jump to content
crs12decoder

simple gd php challenge

Recommended Posts

Am facut si eu un mic script.

/**
* @author djwap
* @copyright 2011
*/

header("Content-type: image/png");

$width = 500;
$height = 500;

$fxc = rand(0, $width);
$fyc = rand(0, $height);
$sxc = rand(0, $width);
$syc = rand(0, $height);

$sxc2 = $sxc <= floor($width / 2) ? rand(floor($width / 2), $width) : rand(0, floor($width / 2));
$syc2 = $syc <= floor($height / 2) ? rand(floor($height / 2), $height): rand(0, floor($height / 2));

$i = imagecreate($width, $height);

$black = imagecolorallocate($i, 0, 0, 0);
$white = imagecolorallocate($i, 255, 255, 255);
$blue = imagecolorallocate($i, 0, 128, 255);
$red = imagecolorallocate($i, 255, 0, 0);

imageline($i, $fxc, $fyc, $sxc, $syc, $white);
imageline($i, $sxc, $syc, $sxc2, $syc2, $blue);
imageline($i, $fxc, $fyc, $sxc2, $syc2, $red);

imagepng($i);
imagedestroy($i);

:)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...