Hi,
I'm trying to count the number of files I have in my strips folder for my comic site. I want to then put that number into a variable that will help me to automate the update process.
I tried this code to open the directory and list the files in it but didn't get much luck.
<?php
$dh = opendir("/images/strips/");
if (!$dh)
{
die("Failed to open directory");
}
$s = readdir($dh);
while ($s)
{
echo "<br>$s";
$s = readdir($dh);
}
closedir($dh);
?>
the resulting error message I get is this.
Warning: OpenDir: Invalid argument (errno 22) in d:\html\users\rwwrcom\html\test.php on line 2
Failed to open directory
So what did I do wrong? And how do I fix it?