![]() Topic awaiting preservation: PHP --> looping through directory (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: there...no..there..... |
![]() I have a directory called "post" that I need to loop through and open each file. code: <?
code: <?
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Well, this: |
Maniac (V) Inmate From: there...no..there..... |
![]() Bit: |
Maniac (V) Inmate From: there...no..there..... |
![]() Here are the errors that I get with that code. Got any suggestoins as what is freaking going wrong? quote:
|
Maniac (V) Mad Scientist From: :morF |
![]() The only problem you really have there is that the directories or files you're trying ot open, you don't have permission to open, then the two file handler functions after that (what I'm assuming are fread() and fclose()) won't validate since the file variable you're handing them essentially doesn't exist. This repeats three times in the file since you try to do the same thing each time... |
Maniac (V) Inmate From: there...no..there..... |
![]() Well maybe I just don't understand the whole "permission" thing. This is just running on my home box with phpDev for practice and testing. |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() It looks like your code is trying to open things it shouldn't. You need to include something in your code to stop fopen() from trying to open the . and .. which are directories, not files. Something like this: code: if($readdir !== '..' && $readdir !== '.') {
code: $filename = "posts/1066250730posts.dat";
|
Maniac (V) Inmate From: there...no..there..... |
![]() quote:
|