| Server IP : 172.67.201.108 / Your IP : 216.73.217.54 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/mitzvahm/wwwdevplanner/mod/ |
Upload File : |
<?php
// captcha code
session_start();
if (isset($_POST['len'])) :
$len = $_POST['len'];
else :
$len = 6;
endif;
//$md5 = md5(microtime() * mktime());
//$string = strtolower(substr($md5,0,$len));
$string = '';
$possible = '23456789bcdfghjkmnprstvwxyz';
$i = 0;
while ($i < $len) :
$string .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
$i++;
endwhile;
$display_string = '';
for ($i=0; $i< $len; $i++) :
$display_string = $display_string.substr($string,$i,1).' ';
endfor;
//$captcha = imagecreatefrompng("./captcha.png");
$captcha = imagecreatetruecolor(100,31);
$font_color = imagecolorallocate($captcha,211,205,214);
$line_color = imagecolorallocate($captcha,211,205,214);
$bg = imagecolorallocate($captcha,95,92,93);
imagefill($captcha, 0, 0, $bg);
//for ($i=1; $i<= intval($len * 1.5); $i++) :
imagesetthickness ($captcha,1);
for ($i=0; $i< 100; $i = $i + 25) :
$x1 = rand($i,$i + 10);
$x2 = rand($x1-20,$x1+20);
$y1 = rand(0,31);
$y2 = rand(0,31);
imageline($captcha,$x1,3,$x2,28,$line_color);
endfor;
//imageline($captcha,40,0,64,29,$line_color);
imagestring($captcha, 4, 5, 5, $display_string, $font_color);
$_SESSION['captcha_key'] = md5($string);
header("Content-type: image/png");
imagepng($captcha);
// end captcha code
?>