I am trying to download all .txt files from a folder on my homepage, but i get an error message that says:
Warning: OpenDir: Invalid argument (errno 22) in c:\phpweb\gameuniverse design 2\cheats\pc\dl.php on line 5
Fatal error: Call to a member function on a non-object in c:\phpweb\gameuniverse design 2\cheats\pc\dl.php on line 7
Here is my script:
<?
$filepath = "$local = "c:\\";
$dir = dir($filepath);
while($f=$dir->read()) {
// if entry is system file (doesn't have picture files), go to next entry in
// "while" loop
if($entry == "." || $entry == ".." {
continue;
}
if (substr($f,-4)==".txt" {
$fp1 = fopen($f,"r"
$fp2 = fopen($local,"w+"
Print("Opened them..."
while(!feof($fp1)) {
$line = fread($fp1,1024);
fputs($fp2,$line,strlen($line));
fclose($fp1);
fclose($fp2);
}
}
}
?>
What is wrong?? Do I have to CHMOD the directory?, in case how do i do that(I dont have ftp account)
Warning: OpenDir: Invalid argument (errno 22) in c:\phpweb\gameuniverse design 2\cheats\pc\dl.php on line 5
Fatal error: Call to a member function on a non-object in c:\phpweb\gameuniverse design 2\cheats\pc\dl.php on line 7
Here is my script:
<?
$filepath = "$local = "c:\\";
$dir = dir($filepath);
while($f=$dir->read()) {
// if entry is system file (doesn't have picture files), go to next entry in
// "while" loop
if($entry == "." || $entry == ".." {
continue;
}
if (substr($f,-4)==".txt" {
$fp1 = fopen($f,"r"
$fp2 = fopen($local,"w+"
Print("Opened them..."
while(!feof($fp1)) {
$line = fread($fp1,1024);
fputs($fp2,$line,strlen($line));
fclose($fp1);
fclose($fp2);
}
}
}
?>
What is wrong?? Do I have to CHMOD the directory?, in case how do i do that(I dont have ftp account)