So what I need is to add something to the code below that changes the file name to something random and uploads it as that random file name.
This is what i have. What do i have to add to it to make it change the file name to something random?
<?php
// ==============
// Configuration
// ==============
$uploaddir = "upload"; // Where you want the files to upload to - Important: Make sure this folders permissions is 0777!
$allowed_ext = "swf, SWF"; // These are the allowed extensions of the files that are uploaded
$max_size = "5000000"; // 50000 is the same as 50kb
$max_height = ""; // This is in pixels - Leave this field empty if you don't want to upload images
$max_width = ""; // This is in pixels - Leave this field empty if you don't want to upload images
// The Upload Part
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
}
print "Your files have been uploaded successfully! Thank you for submitting your flash game to GameRinger! We will contact you soon regarding how you would like to be recognized for your game submission.";
} else {
print "File extension is not permitted!";
}
?>
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks