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'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.
I've found a script that works!
I'm also quite surprised how much I've learnt in the two days I've tried it too!
//user defined variables
$abpath = "./games"; //Absolute path to where games are uploaded. No trailing slash
$sizelim = "no"; //Do you want size limit, yes or no
$size = "2500000"; //What do you want size limited to be if there is one
$number_of_uploads = 3; //Number of uploads to occur
if ($_REQUEST['submitted']){ // Begin processing portion of script
//all file types to upload
$cert1 = "flash/swf"; //swf flash
$log = "";
for ($i=0; $i<$number_of_uploads; $i++) {
//checks if file exists
if ($img_name[$i] == "") {
$log .= "No file selected for upload $i
";
}
if ($img_name[$i] != "") {
//checks if file exists
if (file_exists("$abpath/$img_name[$i]")) {
$log .= "File $i already existed
";
} else {
//checks if files to big
if (($sizelim == "yes") && ($img_size[$i] > $size)) {
$log .= "File $i was too big
";
} else {
//Checks if file is an image
if (($img_type[$i] == $cert1) or ($img_type[$i] == $cert2) or ($img_type[$i] == $cert3) or ($img_type[$i] == $cert4) or ($img_type[$i] == $cert5) or ($img_type[$i] == $cert6) or ($img_type[$i] == $cert7) or ($img_type[$i] == $cert8) or ($img_type[$i] == $cert9) or ($img_type[$i] == $cert10) or ($img_type[$i] == $cert11) or ($img_type[$i] == $cert12) or ($img_type[$i] == $cert13) or ($img_type[$i] == $cert14) or ($img_type[$i] == $cert15) or ($img_type[$i] == $cert16) or ($img_type[$i] == $cert17)) {
@copy($img[$i], "$abpath/$img_name[$i]") or $log .= "Couldn't copy Flash game 1 to server
";
if (file_exists("$abpath/$img_name[$i]")) {
$log .= "File $i was uploaded
";
}
} else {
$log .= "File $i is not an Flash game
";
}
}
}
}
}
?>
Log:
echo "$log";
?>
exit;
} // End processing portion of script
?>
They won't allwo it :)
Ah...
I was all looking forward to that...
Good job none of the files work then isn't it!