kalabox Posted May 14, 2011 Report Share Posted May 14, 2011 Sveiki, nevaru ierubiities, kaut kas ar serveri laikam, uzliku lapu uz jauna hosta, un nestraada capcha, luuk kods antirobot.php <? $wdth=160; $hght=60; $cch=4; $font='../images/bent_titul.ttf'; $alpha_bg=120; $fontsize=8; $let=array('1','2','3','4','5','6','7','8','9','0'); session_start(); $host=parse_url(@$_SERVER['HTTP_REFERER']); if(@$host['host']!=@$_SERVER['HTTP_HOST']){header('HTTP/1.0 404 Not Found');die();} $fntsz=intval($hght/(($hght/$wdth)*$fontsize));$cc=array(); $src=imagecreatetruecolor($wdth,$hght);$fon=imagecolorallocate($src,255,255,255);imagefill($src,0,0,$fon); for($i=0;$i<$cch;$i++){$hw=1;$color=imagecolorallocatealpha($src,0,0,0,75);$letter=$let[rand(0,sizeof($let)-1)]; $size=rand($fntsz*2.1-1,$fntsz*2.1+1); $x=(empty($x)) ? $wdth*0.08 : $x+($wdth*0.8)/$cch+rand(0,$wdth*0.01); $y=($hw==rand(1,2))?(($hght*1.15*3)/4)+ rand(0,$hght*0.02):(($hght*1.15*3)/4)- rand(0,$hght*0.02); $angle=rand(20,40);$cc[]=$letter; if($hw==rand(1,2))$angle=rand(355,340);imagettftext($src,$size,$angle,$x,$y,$color,$font,$letter); } $_SESSION['securityCode']=implode('',$cc);$timemodified=time(); header('ETag: "'.md5($timemodified).'"'); header('Last-Modified: '.gmdate("D, d M Y H:i:s",$timemodified).' GMT'); header('Expires: Fri, 22 May 2009 14:37:18 GMT'); header('Cache-Control: no-cache'); header('Pragma: no-cache'); header("Content-type: image/GIF"); imagejpeg($src);imagedestroy($src); ?> htacesaa man ir taads kods RewriteRule code.GIF core/antirobot.php un kur tiek izvadiits capcha ir taads kods <a href=\"#\" onclick=\"document.getElementById('hello_bot').src='code.GIF?'+Math.random();return false;\">".$lang[2031]."</a>)<br /><br /> <img alt=\"".$lang[203]."\" id=\"hello_bot\" src=\"code.GIF?".microtime()."\" /> Quote Link to comment Share on other sites More sharing options...
briedis Posted May 14, 2011 Report Share Posted May 14, 2011 Varbūt sāc meklēt, kas tieši nestrādā? Netiek atrasts kaptchas kods? Neizdrukājas pareizi? Nevalidējas? Mācies debugot! Quote Link to comment Share on other sites More sharing options...
kalabox Posted May 14, 2011 Author Report Share Posted May 14, 2011 (edited) Netiek attēloti gif attēli, ieliekot gif attēlu mapē images, un norādot celju uz gif attēlu, netiek rādīts attēls. Edited May 14, 2011 by kalabox Quote Link to comment Share on other sites More sharing options...
Rincewind Posted May 14, 2011 Report Share Posted May 14, 2011 Netiek attēloti gif attēli, ieliekot gif attēlu mapē images, un norādot celju uz gif attēlu, netiek rādīts attēls. Firebug zini? Atver Net sadaļu un skaties kas tur sarkans. Quote Link to comment Share on other sites More sharing options...
Val Posted May 14, 2011 Report Share Posted May 14, 2011 Mācies debugot! Pa 5 gadiem forumā gan jau būs šo to apguvis :D Quote Link to comment Share on other sites More sharing options...
kalabox Posted May 15, 2011 Author Report Share Posted May 15, 2011 Par gif attēliem no images mapes tiku galā, bija atsevišķi attēli, kuriem extension bija ar lieliem burtiem ti. GIF, nomainīju uz bilde.gif aizgaaja, ar capcha veel mocos Quote Link to comment Share on other sites More sharing options...
Val Posted May 15, 2011 Report Share Posted May 15, 2011 antirobot.php adrese pārlūkā atveras? code.GIF adrese pārlūkā atveras? p.s. man tas kods ar minimālām izmaiņām uz localhost darbojas. 5x izlasi usera briedis postu. Quote Link to comment Share on other sites More sharing options...
kalabox Posted May 15, 2011 Author Report Share Posted May 15, 2011 (edited) atverot antirobot.php izmet tādu kļūdu Fatal error: Call to undefined function imagettftext() in /home/kalaboxs/public_html/core/antirobot.php on line 19 Hostam laikam nav freetypes uzinstaleets? jaameiko uz imagestring Edited May 15, 2011 by kalabox Quote Link to comment Share on other sites More sharing options...
kalabox Posted May 16, 2011 Author Report Share Posted May 16, 2011 hmm,ienaca taada doma, a ja es to antirobot.php paarvietoju uz citu bezmaksas serveri, kur man jau staav cita lapa, un ir freetypes uzinstaleets, darbotos man capcha? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.