Sitemap Help!
Posted: Mon Sep 29, 2003 1:16 am
Hi!
I'm writing a script that generates a site map.
What I to be enabled to do is stop certain files from showing. The files that I don't want to be shown is in the disfiles.txt file in this format(One file per line):
And then I use PHP to select all the files and open disfiles.txt:
But when I go to the page that shows the files, it says this:
Is there a way to get the for ($i=0;$i<sizeof($filecontents);$i++) function to work in the while ($file = readdir($handle)) function?
Or is there another way?
Thanks
I'm writing a script that generates a site map.
What I to be enabled to do is stop certain files from showing. The files that I don't want to be shown is in the disfiles.txt file in this format(One file per line):
Code: Select all
secret.php
hide.html
dont_show.phpCode: Select all
<?php
$filecontents = file("disfiles.txt");
$handle=opendir('.');
while ($file = readdir($handle)) {
if (is_file("./$file")) {
for ($i=0;$i<sizeof($filecontents);$i++) {
if ($file == $filecontents[$i] || $file == "disfiles.txt") {
print "";
} else {
print "$file\n<br>";
}
}
}
}
closedir($handle);
?>Code: Select all
dont_show.php
dont_show.php
hide.html
hide.html
hide.html
index.php
index.php
index.php
secret.php
secret.php
secret.phpOr is there another way?
Thanks