PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Im trying to view information stored in just .txt files on a server, as well as count the number of rows in each .txt file... place the row number beside the row of information.. etc. this is what i have but only the last record in the locations.txt file is showing up.. locations.txt being the where the URL to all the files are. this is the code..
i get this error with the others
Warning: file(http://myserver.come/folder2/text2.txt ): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /folder/count2.php on line 5
which causes problems with the foreach functions..
Anyone know?
there's extra bytes in the filename that you are requesting that make it fail, I'd bet. use [php_man]trim()[/php_man] on each url before requesting it, or better yet, directly access the file to save on bandwidth and time spent waiting for transfers to occur.
I was thinking, is it possible for me to make it simply display the text file url and the number of rows of data beside it so i can just click on the fine url beide it to bring up the actual file?
I mean, this works... but it counts with 0 being the first line.. and its hard to read.. this is the code i've been using..
its pretty much the same as before just with the trim() function.. i dunno, maybe someone knows a good tutorial where i could possibly learn to do this..
-thanks
now, your script will need some $_GET['load'] handling to know which file to load, which you just need to load the file list, check that the index number requested exists and attempt to load it as you already have..