The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I have a nice little PHP script which saves me a lot of fiddling on my site which is as follows:
// Define the full path to your folder from root
$path = "/home/freehost/t35.com/s/t/stevesmiscellany/WEBSITES/";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "sitemap.php" )
continue;
echo "$file";
}
// Close
closedir($dir_handle);
?>
The problem is that it displays all the files as a continuouse list one after each other, bu I want it to put "Enter"s inbetewn each file as per
in HTML. How would I change the script to do this?
Many Thanks
S.A.
I have a nice little PHP script which saves me a lot of fiddling on my site which is as follows:
// Define the full path to your folder from root
$path = "/home/freehost/t35.com/s/t/stevesmiscellany/WEBSITES/";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "sitemap.php" )
continue;
echo "$file";
}
// Close
closedir($dir_handle);
?>
The problem is that it displays all the files as a continuouse list one after each other, bu I want it to put "Enter"s inbetewn each file as per
in HTML. How would I change the script to do this?
Many Thanks
S.A.
Thanks
S.A.
'); below your current echo function may work.
> I'm not sure how that script works in its current form, but adding
> echo('
'); below your current echo
> function may work.
Alas, that does not work. I had tried that and it just adds an enter to the end of th list.
I'll post the URL to show you what I mean by a continousise list:
http://stevesmiscellany.t35.com/sitemap.php
S.A.
to the end of the echo? Of course, it's probably me just not understanding exactly what you want to do... :-\
S.A.
> I'm don't really know much about PHP, but couldn't you just add
> />
> not understanding exactly what you want to do... :-\
Oh, and cheers for your help, it pushed me in the right dirrection.
I'm not sure if it's the same as Perl, but something like this would do it:
$new=$file;
$new=~s/[.]+$//;
You'll probably need a very similar script, I'm sure somone on this forum will know.