darkfreaks Posted September 1, 2007 Share Posted September 1, 2007 imagecreatefrompng(captcha.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory on line 19 of captcha.php what exactly is wrong on this line? someone told me i need to change the path what path? Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 1, 2007 Share Posted September 1, 2007 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. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 1, 2007 Author Share Posted September 1, 2007 i dont understand ??? Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 1, 2007 Share Posted September 1, 2007 What u dont understand, to put captcha.png between quotes, or what a path is? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 1, 2007 Author Share Posted September 1, 2007 welll i dont get why its erroring. i have it in quotes. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 1, 2007 Share Posted September 1, 2007 You need the full path, if captcha.png is NOT in the same directory as this file. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 1, 2007 Author Share Posted September 1, 2007 thats what im not getting it is in the same folder? :-\ Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 1, 2007 Share Posted September 1, 2007 Show us the actual code please. And if possible, a link to the page. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 1, 2007 Author Share Posted September 1, 2007 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); ?> Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 1, 2007 Share Posted September 1, 2007 So that file is in the folder Guestbook? Why don't you just put in the whole URL and see if that works. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 1, 2007 Author Share Posted September 1, 2007 ‰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“úöíÈ(**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 ?? Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 2, 2007 Share Posted September 2, 2007 POST THE CODE Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 2, 2007 Author Share Posted September 2, 2007 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); ?> Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 2, 2007 Share Posted September 2, 2007 header('Content-type: image/png'); Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 2, 2007 Author Share Posted September 2, 2007 if i put header it wont work properly and error. Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 2, 2007 Share Posted September 2, 2007 if u dont put the header, u wont have an image displayed, but those strange characters. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 2, 2007 Author Share Posted September 2, 2007 oh no it works fine without it but i think its because something jesi suggested i do in the html for my captcha form Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 2, 2007 Author Share Posted September 2, 2007 form.php <img src="http://www.wiccan-gathering.com/lilysgraveyard/addons/Guestbook/guestbook.php?t=<?php print time(); ?>" border="0"> Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 2, 2007 Share Posted September 2, 2007 guestbook.php Is not the same file as captcha.php. You need the header() that was posted in order to make an image. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 2, 2007 Author Share Posted September 2, 2007 im still getting the error about imagecreatepng('captcha.png'); Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 2, 2007 Share Posted September 2, 2007 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. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 2, 2007 Author Share Posted September 2, 2007 according to my error log imagecreatefrompng(captcha.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 2, 2007 Share Posted September 2, 2007 Well I guess we can't help you. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 2, 2007 Author Share Posted September 2, 2007 http://www.codewalkers.com/c/a/Miscellaneous/Creating-a-CAPTCHA-with-PHP/ is the link to the tutorial maybe i missed something? Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 2, 2007 Share Posted September 2, 2007 It looks like you don't have the header line in still. 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.