Autor Zprva
lukasb
Profil
Prosm vs, mm tento script, ale v tom formuli se mi nezobraz ten obrzek captchy. nevm, kde mm chybu :-(

formul
<form action="aaa.php" method="post" name="myform">
<table>
<tr><td>Captcha image:</td>
<td><img src="captcha.php" border="0"></td></tr>
<tr><td>String:</td>
<td><input type="text" name="code" value=""></td></tr>
<tr><td></td>
<td><input type="submit" value="Submit Form" onclick="return checkform()"></td>
</tr>
</table>
</form>



script


session_start();
$charlist = '23456789ABCDEFGHJKMNPQRSTVWXYZ'; 
$chars = 5;
$i = 0;
while ($i < $chars) 
{ 
  $string .= substr($charlist, mt_rand(0, strlen($charlist)-1), 1);
  $i++;
}

$captcha = imagecreatefrompng('captcha.png');
$col = imagecolorallocate($captcha, 240, 200, 240);
imagettftext($captcha, 17, 0, 13, 22, $col, 'Whimsy.TTF', $string);
$_SESSION['secret_string'] = $string;
header("Content-type: image/png");
imagepng($captcha);

a m to prost nevykresli :(.dky za rady!
Joker
Profil
lukasb:
Zkontrolujte, jestli je sprvn adresa obrzku (pedpokldm, e msto obrzku je przdn rmeek nebo ikonka chybjcho obrzku, na to kliknete pravm a tam nkde pjde vykoukat adresa, nejsp asi Vlastnosti)
lukasb
Profil
omlouvm se, ale nebyl jsem k dispozici,proto pu a ted. kdy otevu ten soubor captcha.php, tak mi to nape toto:

Warning: imagettftext() [function.imagettftext]: Could not find/open font in captcha.php on line 20

Warning: Cannot modify header information - headers already sent by (output started at captcha.php:20) 
in captcha.php on line 26
‰PNG  IHDR`\Ҧ IDAThYil\>wy=™‚; ’&not; -P-%ai…kU&micro;R$Eji&laquo;&para;T-E&not;e-P! ‰C'vx‰w{<‹g=qg&NB =?,y{w"€ „ϳ ' !W\ٲx^Ʊ’r†V?9|‚„€”l`W‡~ &laquo;&laquo;&middot;[-”RD$_‚5Z"6&laquo;G}ECK4o&not;kYT€” ~| ”t!…P B $€J b) ^$BM|4~~1‡ݺ›&reg;!J0(fi“&6“I)AT‡ {(&brvbar;q… ""r9c“&para;[wvlr± ?tB3Y“9c0&para;=N‡ Q83iq9QJ)=W…r 3 “'&~&reg;]T.s•H)…Q‹_…kk&brvbar;~޽=f&raquo;&brvbar;_Y^r&copy;&reg;r97Xu9mc5i_uC‚…„G{XpPDRRJ”o}’_5Jl P(:•L)Ƴ9}22Mb&copy;P4'D$‡F㷈&middot;7&middot;.(Xb6}skfiQs‘^Wkӯ6Ww&micro;Z0, "ɘnhA 4Nv Dd&ON%S™&not;>eu=:•3ijq&not;x’T2•†"1X(››-–@i*&laquo;Įvk}M o—&not;&brvbar;\}9e.g}js)N  &copy;QI%€2XEb=&plusmn;Dr5&middot;9lo{ 8€!dW Qx&copy;—ٰy‚&brvbar;&raquo;W]ղn4Ӳ wQdtv–On7^‹&raquo;Wm‰e*d&raquo;{RHJLTfWl{.x&middot;47T€b™”’8 †*RFUbʮ=W,}ys6‹jQSEq Q™EJd”lb?>=ppOw …n~1:-|BH‰f“&brvbar;D&middot;O'mMu+Z*ysjPj'Lg&-ϸc;&para;x"9&raquo;+\9cg&brvbar;V…!(j&middot;R&middot;n0Di‰a;oN&micro;\")"oj“•…”B‹٤NV|ee’K/X߷a‡ $U‰U&raquo;:z&middot; o<']PD™”RV&raquo;F&reg;8 ! 9dSk7n&laquo;Cة+[&reg;W‰KKYl~† ”€p,>4 …&para;&para;V‡+&reg;B4›)!”“jwP4@(Bȿ[u•–/-&plusmn;4O_r*J!d<•y'y&raquo;W&laquo;,& 82Mk>^[U]7]ٲH4 Q&L"ט}к‰Vw^&reg;Tx\%vV M€fp&plusmn;_”=t‡&para;]_v,9‘{o)t&K)妾&brvbar;RM&copy;‘?]=j67+ MjV&plusmn;;V>›z.%BpT }&micro;]uD0„p›&reg;nB&brvbar;m—cmQ”X&not;K xO‘€YlfӲE-_'†1+t:B“O&middot;U‡"ѿ<&middot;z5~_s}W[`^V3|,&reg;742;8vqciI>+f@'f^ _…5Ev{w6&middot;X^SUa1›V™#uC2t&{›nڰesy…M „0„ ”N&not;3 &plusmn;4plǵ&middot;'5-[8&middot;.cMj–”r`4ž/t:l&para;r~SUfFuzVIEND&reg;B`‚


opravdu nevim, co s tm :-(. kdy to poutm na localhost,tak to v pohod b, ale kdy to ulom na web ((*********)) tak to prost nezobraz :-(. vechny soubory, jak font,tak pozad tam je. dky!
keeehi
Profil
zkontroluj si ped <?php mezery
a koukni sem
Alphard
Profil
lukasb:
kdy otevu ten soubor captcha.php, tak mi to nape toto:
To jste ml napsat hned.
Problm je zejm v cest k fontu. Jestli si vzpomnm, zle to na verzi PHP, mrknte do manulu. Druh warning je jen dsledek.
lukasb
Profil
dkuji moc, ted si tu manul, ale njak mi to nen jasn,co mm tedy udlat :-(
viz citace z www.php.net o imagettftext

The path to the TrueType font you wish to use.

Depending on which version of the GD library PHP is using, when fontfile does not begin with a leading / then .ttf will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.

When using versions of the GD library lower than 2.0.18, a space character, rather than a semicolon, was used as the 'path separator' for different font files. Unintentional use of this feature will result in the warning message: Warning: Could not find/open font. For these affected versions, the only solution is moving the font to a path which does not contain spaces.

In many cases where a font resides in the same directory as the script using it the following trick will alleviate any include problems.

<?php
// Set the enviroment variable for GD
putenv('GDFONTPATH=' . realpath('.'));

// Name the font to be used (note the lack of the .ttf extension)
$font = 'SomeFont';
?>
JohnyPb
Profil *
lukasb:

asi mon nen aktuln, ale po dvou dnech jsem tuto chybu odboural PsPad-u zmnou jazyka zkuste....

zatjal Johny

Vae odpov

Mohlo by se hodit


Prosm pouvejte diakritiku a interpunkci.

Ochrana proti spamu. Napite prosm slo dv-sta tyicet-sedm: