GetDotted Domains

Viewing Thread:
"PHP help required..."

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.

Fri 19/03/04 at 17:14
Regular
"Digging!"
Posts: 1,560
Hay all,
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.
Fri 19/03/04 at 17:20
Regular
"bing bang bong"
Posts: 3,040
I'm not sure how that script works in its current form, but adding echo('

 

'); below your current echo function may work.
Fri 19/03/04 at 17:17
Regular
"Digging!"
Posts: 1,560
AH, a while I'm here, how would I go about stoping it showng the file extensions? e.g. home.php to just home.

Thanks
S.A.
Fri 19/03/04 at 17:14
Regular
"Digging!"
Posts: 1,560
Hay all,
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.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Great services and friendly support
I have been a subscriber to your service for more than 9 yrs. I have got at least 12 other people to sign up to Freeola. This is due to the great services offered and the responsive friendly support.
10/10
Over the years I've become very jaded after many bad experiences with customer services, you have bucked the trend. Polite and efficient from the Freeola team, well done to all involved.

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.