Hallo,
ich habe ein mehr oder weniger großes Problem mit dem Video Host Script von phpmotion
habe es HIERzu testzwecken installiert, leider wird der Captcha bei der Anmeldung nicht angezeigt, wodurch ich mich nun nicht Anmelden kann,
Könnt ihr mir bei der Lösung des Problems helfen, da mir dort im Forum nicht geholfen werden konnte,
Hier mal die image.php (dort wird der Captcha generiert)
Der Captcha wird durch den Schrift FONT
Alpha Romanie G98 erstellt
die GD Library ist Installiert etc
Danke im Vorraus
ich habe ein mehr oder weniger großes Problem mit dem Video Host Script von phpmotion
habe es HIERzu testzwecken installiert, leider wird der Captcha bei der Anmeldung nicht angezeigt, wodurch ich mich nun nicht Anmelden kann,
Könnt ihr mir bei der Lösung des Problems helfen, da mir dort im Forum nicht geholfen werden konnte,
Hier mal die image.php (dort wird der Captcha generiert)
PHP:
<?
/*
* Captcha
*
* Created on February 3, 2007
* Developer: Maria Erlandson
* http://www.teasso.com
*
*/
session_start();
//Set these avriables as you see fit
$fontsize = 18;
$numcharacters = 6;
$bgcolor = "3968c7";
$textcolor = "FFFFFF";
$num_interference_lines = 0;
//At least one of these MUST be true
$str_includes_numbers = true;
$str_includes_uppercase = true;
$str_includes_lowercase = true;
//Generate Captcha String
$_SESSION['teassocaptcha'] = RandString($numcharacters, $str_includes_numbers, $str_includes_uppercase, $str_includes_lowercase);
//Send a generated image to the browser
create_image($numcharacters, $fontsize, $bgcolor, $textcolor, $num_interference_lines);
exit();
function create_image($length, $fontsize, $bgcolor, $textcolor, $numlines)
{
//Set the image width and height
$trifont = 1.5 * $fontsize;
$width = ($trifont * $length);
$height = 3 * $fontsize;
//Create the image resource
$image = imagecreate($width, $height);
//We are making colors
$forecolor = imagecolorallocate($image, hexdec(substr($textcolor,0,2)), hexdec(substr($textcolor,2,2)), hexdec(substr($textcolor,4,2)));
$backcolor = imagecolorallocate($image, hexdec(substr($bgcolor,0,2)), hexdec(substr($bgcolor,2,2)), hexdec(substr($bgcolor,4,2)));
//Make the background backcolor
imagefill($image, 0, 0, $backcolor);
//Add randomly generated string in forecolor to the image
//imagestring($image, 7, 30, 3, $pass, $forecolor);
//Tell the browser what kind of file is come in
header("Content-Type: image/jpeg");
//imageloadfont("Alpha Romanie G98.ttf");
for($i = 0; $i < $length; $i++) {
$source = imagecreate($trifont, $trifont);
//We are making colors
$forecolors = imagecolorallocate($source, hexdec(substr($textcolor,0,2)), hexdec(substr($textcolor,2,2)), hexdec(substr($textcolor,4,2)));
$backcolors = imagecolorallocate($source, hexdec(substr($bgcolor,0,2)), hexdec(substr($bgcolor,2,2)), hexdec(substr($bgcolor,4,2)));
imagefill($source, 0, 0, $backcolors);
// changed 04-28-08 to test for proper gd lib ttf function
if (function_exists('imagettftext')) {
imagettftext($source, $fontsize, 0, 0, 18, $forecolors, "Alpha Romanie G98.ttf", substr($_SESSION['teassocaptcha'], $i, 1));
} else {
imagestring($source, 5, 3, 0, substr($_SESSION['teassocaptcha'], $i, 1), $forecolors);
}
//imagettftext($source, $fontsize, 0, 0, 18, $forecolors, "Alpha Romanie G98.ttf", substr($_SESSION['teassocaptcha'], $i, 1));
//Rotate Somehow
switch(mt_rand(1,8)) {
case 1:
$source = imagerotate($source, -20, $backcolors);
break;
case 2:
$source = imagerotate($source, 20, $backcolors);
break;
case 3:
$source = imagerotate($source, -15, $backcolors);
break;
case 4:
$source = imagerotate($source, 15, $backcolors);
break;
case 5:
$source = imagerotate($source, -10, $backcolors);
break;
case 6:
$source = imagerotate($source, 10, $backcolors);
break;
case 7:
$source = imagerotate($source, -2, $backcolors);
break;
case 8:
$source = imagerotate($source, 2, $backcolors);
break;
}
//Set Location variables
$loc_x = 5+($trifont*$i);
$loc_y = $trifont/2 + mt_rand((-1 * $fontsize/10),($fontsize/10));
//Set Size Variables
$size_x = $trifont * (mt_rand(100, 110) / 100);
$size_y = $trifont * (mt_rand(100, 110) / 100);
imagecopymerge($image,$source,$loc_x,$loc_y,0,0,$size_x,$size_y,90);
imagedestroy($source);
}
/*Throw in some lines to make it a little bit harder for any bots to break */
imagesetstyle($image, array($forecolor, $forecolor, $forecolor, $forecolor, $forecolor, $forecolor, $forecolor, $forecolor, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT));
imagerectangle($image,0,0,$width-1,$height-1,$forecolor);
//for($i = 1; $i < mt_rand(1,5); $i++) {
for($i = 1; $i < (1 + $numlines); $i++) {
$from_x = mt_rand(0, $width);
$from_y = mt_rand(0, $height);
$to_x = mt_rand(0, $width);
$to_y = mt_rand(0, $height);
imageline($image, $from_x, $from_y, $to_x, $to_y, IMG_COLOR_STYLED);
}
//Output the newly created image in jpeg format
imagejpeg($image);
//Free up resources
imagedestroy($image);
}
function RandString($len, $num, $uc, $lc) {
if (!$len || $len<1 || $len>100) {
print "Error: \"Length\" out of range (1-100)<br>\n";
return;
}
if (!$num && !$uc && !$lc) {
print "Error: No character types specified<br>\n";
return;
}
$s="";
$i=0;
do {
switch(mt_rand(1,3)) {
// get number - ASCII characters (0:48 through 9:57)
case 1:
if ($num==1) {
$s .= chr(mt_rand(48,57));
$i++;
}
break;
// get uppercase letter - ASCII characters (a:65 through z:90)
case 2:
if ($uc==1) {
$s .= chr(mt_rand(65,90));
$i++;
}
break;
// get lowercase letter - ASCII characters (A:97 through Z:122)
case 3:
if ($lc==1) {
$s .= chr(mt_rand(97,122));
$i++;
}
break;
}
} while ($i<$len);
return $s;
}
?>
Der Captcha wird durch den Schrift FONT
Alpha Romanie G98 erstellt
die GD Library ist Installiert etc
Danke im Vorraus