Need php help, quick question ;)
I have been building a few things lately for fun, This is a standard upload script, i am having trouble renaming the file, where in the code do i need to change so that i could have a random name or base the name off an Id?
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
|