Jump to content

[SOLVED] Captcha Problem...


darkfreaks

Recommended Posts

imagecreatefrompng('captcha.png')

 

It needs a valid path and that path to be string.

 

what exactly is wrong on this line? someone told me i need to change the path what path?

 

The path of the file is its unique location in the file system, being made of directories and finally the actual file.

Link to comment
Share on other sites

http://www.wiccan-gathering.com/lilysgraveyard/addons/Guestbook/captcha.png

 

 


<?php



//Now lets use md5 to generate a totally random string 
$md5 = md5(microtime() * mktime()); 

/* 
We dont need a 32 character long string so we trim it down to 5 
*/ 
$string = substr($md5,0,5);


/*
Now for the GD stuff, for ease of use lets create 
the image from a background image. 
*/ 

$captcha = imagecreatefrompng('captcha.png');

/* 
Lets set the colours, the colour $line is used to generate lines. 
Using a blue misty colours. The colour codes are in RGB 
*/ 

$black = imagecolorallocate($captcha, 0, 0, 0); 
$line = imagecolorallocate($captcha,233,239,239); 

/* 
Now to make it a little bit harder for any bots to break,  
assuming they can break it so far. Lets add some lines 
in (static lines) to attempt to make the bots life a little harder 
*/ 
imageline($captcha,0,0,39,29,$line); 
imageline($captcha,40,0,64,29,$line);


/* 
Now for the all important writing of the randomly generated string to the image. 
*/ 
imagestring($captcha, 5, 20, 10, $string, $black); 



/* 
Encrypt and store the key inside of a session 
*/ 

$_SESSION['key'] = md5($string); 

/* 
Output the image 
*/ 

("Content-type: image/png"); 
imagepng($captcha);


?> 


Link to comment
Share on other sites

 

‰PNG IHDRdU9,¤øIDAThuZ{tVUvßó-—2ˆ©Î€°\€ü`û7ÞxÛí·k»—Ø?âg×&ëð˜‡oOHbɾÉáwu°ÈjÑàÛïøìðŠr†´˜øR{Ç /¼ðÞ¦M›~¿)çÞ{aC†ˆ1nZ˜Òzi¢¦Y'n¸XÝCÕ wß‚S,iooß²eKvvö Ýn°bŠÖº/ÅÕZpg?_ÄÈoB@<QËTÁÆk3)ãÐð¬¬ú††ú†Ï½Ýb6L†Ùðš5k¦OŸ^VVVXX¨¢æÉ幕[·Wï4ÍA)¿œ1cÖüùNoÀÝ°^­•ÓgN×|òInn®acƒè µ±a'‚e†ñç œîºGƒbaØRˆ?–’ŸžG ’=tèþO?eO\úQ.Ô–úºú¼¼±999o¾ùæ~ÔUfCDèæ·nmÄÕ¥mºjǼ™³fÌý¥ˆÛ&¬ D¬446ž9}:;;¢|Ø M¾Ù®"|þÒ©–‡Ë«WT>¼:ZÞ7¨ñŽãïæ@^3äÝÊ7§þ’ŸŸßÚÚ²qãÆ~ýúyd˜ ˆÀñïe„`‚n“=-˜3§döì¤ZGo®ïG;wöêÕ«OŸ>Ado²ÞÖ­MS*§q6¹9¡´é{ç5Ï[+ØKý]ä(=sÏÈ»wïÛ·{ï^Cl8ºaãã+2Á‚·ß~»ªªjôOG;b3†‰ÈB0Ã7±„dné‹æ¾Rôò̤ü3 /þßö÷·ß}÷Ý]»v Ʋ6È©ØYÇQCÈ€ªÇôŠ˜¸"ˆWµD0 ?iLHH@®¶ïÞ=æžß5BB$D”•µpáÂmÛ¶UTTˆˆÆfHˆHH1ÖaBi@ÄƘ=é¹döì%ååÚÉ0³I…¸Ê3dèýlݲ‰Ø?M¬±šïä#*öaŸ¹Œµ‚V!#!y®AÒ•3#^•³¼âh˜g¢xdÌ?Ü{ßíÜ¡Á¦Z5Ѩs8tøð¤I“²²²^ýõŒŒ vúå†"¤4ÎÇí6:îľCØku–1b‘ƒŸlkk6|xÔTkƒU9³ÁÚ“~¬Xowγ‚w…à ¼z‘Øvb£á·3;à¹?7wëüÇöí ´Ø„?¦³ß}W\\ÜÜÜ\QY‘™y›7Wß“˜ˆ<ʨj”ÇŠ€”—–þâÅ5Øò(øðÉZ vÇŽn¹å–^½z9îoÆ>®Hy´NøyZJÛ(AKˆ`¯vp=bäÏî³Oˆ Îw«×®_[ýï[·n\¿>& DDŒÄL (Ô}îû™3g¶¶¶;Ö“ ö:ª îäÚ õD{÷ìùEIÉþOö¢~é]"$kí™3gFõusó¥K—ôAdßO1?""’N£‡›‘@o#€[éãŽgÐ%|i`õìÙ3Š®r#%àÒ;LDüûõë6mÞ¼iÃv]Ò>ÌÔÜ|¬¾¾~ÚÔ©={öüüóŸEzîB$D"…LÁJÃŒ©¶¦fjQQí¾}”‘< mmmƘ;î¸ãرcJ2H: Âp#Ç1Q2œ[…‹«ˆ7^N[8lØ0L;€”žv¬Û´ þyìXM¹‘ˆÔ= ^}×âââT*õÚk¯UUUÀ£>†QDÄõëׇE(Ÿ/]ºôJå/+/Wþ3)íÅ)“3fÌÍ7ß ï½÷ûÈ&‘¾3cH™“|Xí} ù¬.ÄŽtÙ¡2aXÆ°AŽwe*]&$">•—‡ˆÕ6Œ7.±eàw Û.\(--7nœ"†YoêàÕÕÕðÔÓOÀš·Þª¨¨xö™g…S”””¨7|îùç»|¹ˆ!ˆkíÇìxÙÅk$, ŠPÉS¶O¨,¦š]aº¿A@H‹ˆþèMp{dŒ«†°÷n&4Mü—§Ö¬]ëBQr_†ñ‘G‰ÖnâàŠÔ„ ÔMLž4 –¯XýR·BÎ("`-XëCݶ mÚùšk® Ž.6dÉ6úà«ý·ƒÒ߈/éLoØ0^S3MS£`¼Êž^9‘° ?Õš·ºgd„áüñ@ O>9Žª×®UC«®~§£ã"æçOtônDð%X¸h!Ì›?ï›––Õ+VˆÊü\ásÚ§jͽø›»îÚóIhšhIÈɪjåÈ{G €V€R¨@­¦\ePT 5{ãUÅøPÑ3§Tã\Ìà.RÌŠÔ7--yOäÀÆã@)f“Òiºuë6cÆË?þñOt†” ÛŠ•+`ja!Wu+//+yé¥Y3g@÷ŒŒügžQI§M›+V®XµªrÂøñNæH:.ZŠ¸òP-´1KÆáqAX8ú§£ Òué Š|âÆàÉ'žÄ%¿ùÍ¿N}§úxzüxõF€¸úw¿€)S&?ðÀ?åääTVVþñèQr9.[¶ ¦OŸžôT€Hº[ÄóæÏ×ÍÐ]Y¶l)›”îgþĉ°yóæÜÜÜÚÚÚÖÖÖP;Mä²1yH–NC$îêHW|ðÀ±pj ±g}Ÿéx³ öHIØÈ}З_×­_ëÖ­Kض£sò®×°Ù¶mëñ¯¼ÿþû;vìÄ7~ýkxþ…çQÃvZÀûºzåJg¡ÄZA ÞàüùóuuuÆ Û¹k§tŠ3Ãø¥v-"VÀÆV„ÔgX°"#U—PGÓŒ,oؘ„Þ\¦AnáWÜTqÜ&LPש¨––¿6«¤$DRÚ‡Ä#_Y²dɤI“úöí;DÈ(**JnÉ¢W_€Y3gºˆÄ³XÌIbÞëoýùĉ=z ¾sp}}}ä!M¶ÑŠXõpái èYD]Ÿø2$²ÚrÂJˆ¶(ä,Þ©9¥õÆ$=YTjæ”™˜ŸUUU>96«Vý¶{FÆ‚Å‹•åØ°W`N±1Æ´´¶.}ã Eªlq™77×ìÙ³`Ai©²å+ó^€Ò ÄÊâÅ‹`Ú´iZÈš4yrKÄàl«GBõÀ78UŠŠŠ$ "â¬yó’^Râ⡬¬ ®vÌ;W'š3gNh\´p"SQQ‘¶WVVN™2ª««ÙpŠÍõÝn¸çž¿ß¿ÿùómá½{8–™|­ ƒCBß>hÒÇDZ|HØ>öØãÊí„ ®J!^m®o’üÁe1¨_œ5«¼t!¥[v8úöí;vìØÚÚÚ]»v'¦#gÔ!!@ŸQâ“ãÇoZ·.:ìÈæ¦OŸÞ™™·íÝ[#"ÄsxW—8º²r(Ü$R<Œ<ã4hPÄ6KC=™“.$áL(Ùë†äg&b¢š={Š^žQ[³7-»p}éÜÙ³‡1jԨ̙_ý© @b¹(1nxM Âjøü±qã76Ï,QÅ;wîÜ_edtÿI÷S§NaL<ûãÒrŸB¢·%PTÀµCP/fñwN ªc¤ï}ü»CòN6©»®9'{ÁÂïý55ÓŠ‹FŒüÛºýû}µŸH7¨½ãRã¡ÆÞ½{çääÿúx{{;‡™™‘z~Hä#‡ÎË;rè-ê!!:sútÿýEäÜ÷ç4‹U /¿+2¸’†?{}¾âxðСC8Š†^p ŠCþUkBeükŸðªÃÃãßÍš(.Sݾ}uûkŸ>ýÓº‰\Ö=ˆMMMÖÚûÿñþ³g϶¶~Þ‘põõ\ØL6ôÇÃGxôÑ£G¾ EÕ#hmm4hзߞî¼Ô‘Ô+r ¢RI¸å ¼¥D>|˜7‘XwI+ŸFÓH¨TBÂ5ÅAˆÈúï&?÷¯ëë½ú9›Tþòí·'Oœ“;¦K—.'ÿ÷¤ ƒ}GMÖyúgfþéèÑ(§‡¬££Ãvv8ðäÉ“¡à¬KM2³Z¡çdÄt³EDÐ ®Œ®Â^ÄòN¼Ö¢‘«È8¯˜˜&é@¯øéÉ“`íêÕ1gðá+]×åºÜÜ1¶³óÃ>¼Ø~‘09¡_»7"ýóŸôŸÛÜJ ÔŒa Test Sign Guestbook

 

is what happens when i link it fully ??

Link to comment
Share on other sites

Captcha.php


<?php



//Now lets use md5 to generate a totally random string 
$md5 = md5(microtime() * mktime()); 

/* 
We dont need a 32 character long string so we trim it down to 5 
*/ 
$string = substr($md5,0,5);


/*
Now for the GD stuff, for ease of use lets create 
the image from a background image. 
*/ 

$captcha = imagecreatefrompng('http://www.wiccan-gathering.com/lilysgraveyard/addons/Guestbook/captcha.png');

/* 
Lets set the colours, the colour $line is used to generate lines. 
Using a blue misty colours. The colour codes are in RGB 
*/ 

$black = imagecolorallocate($captcha, 0, 0, 0); 
$line = imagecolorallocate($captcha,233,239,239); 

/* 
Now to make it a little bit harder for any bots to break,  
assuming they can break it so far. Lets add some lines 
in (static lines) to attempt to make the bots life a little harder 
*/ 
imageline($captcha,0,0,39,29,$line); 
imageline($captcha,40,0,64,29,$line);


/* 
Now for the all important writing of the randomly generated string to the image. 
*/ 
imagestring($captcha, 5, 20, 10, $string, $black); 



/* 
Encrypt and store the key inside of a session 
*/ 

$_SESSION['key'] = md5($string); 

/* 
Output the image 
*/ 

("Content-type: image/png"); 
imagepng($captcha);


?> 





Link to comment
Share on other sites

You have so many pages, I don't know where you're getting this error. On the page which is supposed to be generating another image? And you tried using the whole URL?

 

Post the most recent version, each time, because you have several files you're talking about and the error.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.