HEX
Server: Apache
System: Linux pdx1-shared-a1-06 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: ednermusika (2886498)
PHP: 8.4.2
Disabled: NONE
Upload Files
File: /home/ednermusika/ednergranados.com/captcha/captcha.php
<?php
session_start();
//FUNCION QUE GENERA UN TEXTO ALEATORIO
function randomText($length, $type=0) {
	switch ($type) 
	{
		case 0: $pattern = "1234567890ABCDEFGHKLMNPRSTUVWYZ"; break;
		case 1: $pattern = "ABCDEFGHKLMNPRSTUVWYZ"; break;
		case 2: $pattern = "1234567890"; break;
	}
	$max = strlen($pattern)-1;
	for($i=0;$i < $length;$i++) 
		$key .= $pattern{mt_rand(0,$max)
	};
	
	return $key;
}

$texto 				= randomText(5);
$_SESSION['tmptxt'] = $texto;
$fuente 			= 'elephant.ttf';
$captcha 			= imagecreatefrompng("bgcaptcha.png");
$colText 			= imagecolorallocate ($captcha, 0x98, 0x4A, 0xFA);
imagettftext		($captcha, 14, 0, 7, 22, $colText, $fuente, $texto);
header				("Content-type: image/png");
imagepng			($captcha);

?>