sir pannels
07-14-2005, 08:42 PM
Hi There,
I have a bit of code that rips the content of a file.. the code is... $fh = fopen($nurl,"r");
$d="";
while($data = fgets($fh)) {
$d.=$data;
It takes $nurl from a txt box on a previous form, something likehttp://site.ext/var1/var2/var3.txt
However what I wish it to do is only need to be
http://site.ext/var1/var2/
The script should work out the var3(the file name) its self so the URL only needs to go as far as the directory the file is in.
I need to sort out some kind of loop so that it will run that code on every file in the directory so it needs to also work out how many files are in there.
Any one got any links or code to point me in the right direction?
Many Thanks,
Sir P
I have a bit of code that rips the content of a file.. the code is... $fh = fopen($nurl,"r");
$d="";
while($data = fgets($fh)) {
$d.=$data;
It takes $nurl from a txt box on a previous form, something likehttp://site.ext/var1/var2/var3.txt
However what I wish it to do is only need to be
http://site.ext/var1/var2/
The script should work out the var3(the file name) its self so the URL only needs to go as far as the directory the file is in.
I need to sort out some kind of loop so that it will run that code on every file in the directory so it needs to also work out how many files are in there.
Any one got any links or code to point me in the right direction?
Many Thanks,
Sir P