GetDotted Domains

Viewing Thread:
"Shouldn't have tried to learn PHP..."

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.

Tue 29/04/03 at 17:02
Regular
Posts: 787
I knew it, I'll go fine for a few minutes and then crash and burn!

I've learnt how to make a flashy little form now! (Yay!)

Anyway, how would I manage to create a list of files within a directory?

Say I wanted to print all of the files in the directory

http://members.lycos.co.uk/phi11ip/pics/

What would I do?

Is it easy, or slightly harder than I expect in which I'll just leave it!

Thanks.
Tue 29/04/03 at 17:02
Regular
"Chavez, just hush.."
Posts: 11,080
I knew it, I'll go fine for a few minutes and then crash and burn!

I've learnt how to make a flashy little form now! (Yay!)

Anyway, how would I manage to create a list of files within a directory?

Say I wanted to print all of the files in the directory

http://members.lycos.co.uk/phi11ip/pics/

What would I do?

Is it easy, or slightly harder than I expect in which I'll just leave it!

Thanks.
Tue 29/04/03 at 17:07
Regular
"Chavez, just hush.."
Posts: 11,080
Don't worry, I think I've found something...

Hopefully this one should work.
Tue 29/04/03 at 17:09
Regular
"Pouch Ape"
Posts: 14,499
I like PHP. It's fairly easy and the results are always impressive.
Tue 29/04/03 at 17:14
Regular
"Chavez, just hush.."
Posts: 11,080
I'm gonna guess that Lycos doesn't like that type of script..

I'll just download something to make my PC a server so I can test it.
Tue 29/04/03 at 17:19
Regular
"Chavez, just hush.."
Posts: 11,080
*comes walking back after realisingg that he doesn't have a clue what he's looking for*

So, what one should I download!?!?
Wed 30/04/03 at 18:52
Regular
"Unknown Legend"
Posts: 305
Apache I think...
Wed 30/04/03 at 19:05
Regular
"It goes so quickly"
Posts: 4,083
Try putting this in a PHP file, into the directory you want listings for:

$Folders = "";
$Folder_Count = 0;
$Files = "";
$File_Count = 0;
print "
\n";
print "\n";
print " \n";
print " \n";
print " \n";
print " \n";
$dh = opendir("");
while ( gettype($file = readdir($dh)) != boolean) {
if ( is_dir("$file")) {
if ($file != ".") {
if ($file != "..") {
$Folders .= "\t$file\"Folder\"
\n";
$Folder_Count++;
}
}
}
if ( is_file("$file")) {
$Files .= "\t\"File\"$file
\n";
$File_Count++;
}
}
closedir($dh);
print " \n";
print " \n";
print " \n";
print " \n";

$Folder_Text = ($Folder_Count == 1)?"Folder":"Folders";
$File_Text = ($File_Count == 1)?"File":"Files";

print " \n";
print " \n";
print " \n";
print " \n";
print "
FOLDERSFILES
\n$Folders\n";
print "
\n$Files\n";
print "
$Folder_Count $Folder_Text$File_Count $File_Text
\n";
print "
\n";
?>
Wed 30/04/03 at 19:40
Regular
"Chavez, just hush.."
Posts: 11,080
That one doesn't seem to work.

Fatal error: Maximum execution time of 10 seconds exceeded in listing.php on line 22

I found another one which is OK, it creates a thumbnail of all the images in the folder which could be quite useful.

Oh, and this script doesn't seem to be working no matter how hard I try:

This is the form page:






This is the PHP file:

if ($File_name){
if (copy($FileToUpload, "./photos/$File_name")){
echo 'File Name :' . $File_name .';
echo 'File Size :' . $File_size .';
echo 'The file was successfully uploaded!';}
else
echo 'Your file could not be copied.';
unlink($FileToUpload);
?>

I got a parse error on line 4 I think, my crapy attempt to fix it was this:


if ($File_name){
if (copy($FileToUpload, "./photos/$File_name")){
print ("The name of the file is $File_name");
print ("The size of the file is $File_size");
print ('The file was successfully uploaded!");}
else
print ("File not uploaded");
unlink($FileToUpload);

?>

But then I get a parse error on the last line. The close php tag.

Does anybody have any simple file/image uploading scripts?
Wed 30/04/03 at 21:12
Regular
"Chavez, just hush.."
Posts: 11,080
I just can't get any uploading scripts to work.

I've tried on Freeola to test them but it still doesn't work...

Grrr..
Wed 30/04/03 at 21:22
Regular
"It goes so quickly"
Posts: 4,083
You don't appear to have a set Value for $File_name.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Thank you very much for your help!
Top service for free - excellent - thank you very much for your help.
Thanks!
Thank you for dealing with this so promptly it's nice having a service provider that offers a good service, rare to find nowadays.

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.