Re[2]: [PHP] file_exists problems
Hello Prolog, If course it doesn't use relative positioning. You should do it like that file_exists("images/...") instead of ("/images/..."). That's all :) P> I've since tried that also. It too seems to return the same error. I'm P> curious if the file_exists can't use relative positionslike it has to be P> in the same folder or you have to use the whole line like c:\ I'm P> working on a box that isn't mine of the net...if that's the case I don't P> know my full directory line. Just a thought but I'm not sure. I'll include P> my full code below...as it sits now. Maybe you can see something that I P> can't. Ivan 'Faeton aka xetrix' Danishevsky ICQ(240266) [EMAIL PROTECTED] www.xemichat.com ::: Ñåãîäíÿ òðè ðàçà ïîäóìàë... Î÷åíü óñòàë... ::: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file_exists problems
I've since tried that also. It too seems to return the same error. I'm curious if the file_exists can't use relative positionslike it has to be in the same folder or you have to use the whole line like c:\ I'm working on a box that isn't mine of the net...if that's the case I don't know my full directory line. Just a thought but I'm not sure. I'll include my full code below...as it sits now. Maybe you can see something that I can't. - \n"; echo "ImageInfo\n"; do { //filename is the item number + t.jpg -- t shorthand for thumbnail $picname = "$itemnumber t.jpg"; print (""); //if the file exists then print it. Otherwise print a generic image saying it doesn't exist. if (file_exists ("/images/$picname t.jpt") { print (''); print (" $dn $sp - $val $size : \$$priceRelease: $release Preorder This Item\n"); } else { print (""); print (" $dn $sp - $val $size : \$$priceRelease: $release Preorder This Item\n"); } } while ($myrow = mysql_fetch_array($result)); print ("\n)"; //if no results found display this message } else { echo "Sorry, no records were found!"; } $dn = "$myrow["driver_name"]"; $sp = "$myrow["sponsor"]"; $val = "$myrow["value"]"; $size = "$myrow["size"]"; $price = "$myrow["price"]"; $release = "$myrow["release"]"; $itemnumber = "$myrow[item_number]"; ?> - maybe that will help. -Jordan "Faeton" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello Prolog, > > > Hm... And what about: > print ''; > instead of readfile? > > > P> if(file_exists(/images/$filename)) > P> { > P> readfile(/images/$filename); > P> } > P> else > P> { > P> readfile(images/npat.jpg); > P> } > > > > > Ivan 'Faeton aka xetrix' Danishevsky > ICQ(240266) [EMAIL PROTECTED] www.xemichat.com > ::: Ñòîèò òîëüêî çàîñòðèòü âîïðîñ, êàê ñðàçó ïðîñÿò çàêðóãëÿòüñÿ. ::: > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file_exists problems
Hello Prolog, Hm... And what about: print ''; instead of readfile? P> if(file_exists(/images/$filename)) P> { P> readfile(/images/$filename); P> } P> else P> { P> readfile(images/npat.jpg); P> } Ivan 'Faeton aka xetrix' Danishevsky ICQ(240266) [EMAIL PROTECTED] www.xemichat.com ::: Ñòîèò òîëüêî çàîñòðèòü âîïðîñ, êàê ñðàçó ïðîñÿò çàêðóãëÿòüñÿ. ::: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] file_exists problems
I had a script that was running beautiful that simply called up a database and displayed the results in tables. I went to add images to this script and all hell broke loose. This is the portion of the script that I added: -- //filename is the item number + t.jpg -- t shorthand for thumbnail $itemnumber = "$myrow[item_number]"; $filename = "$itemnumber t.jpg"; echo ""; //if the file exists then print it. Otherwise print a generic image saying it doesn't exist. if(file_exists(/images/$filename)) { readfile(/images/$filename); } else { readfile(images/npat.jpg); } - Is there anything I need to know about "file_exists" that I'm not doing. for some reason when this code is added it gives me an error on the line after the close of the else statement. That line was perfectly fine before the addition. Please help. -Jordan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]