<?php
if($_FILES['file']['error']==0){
if($_FILES['file']['type']=='image/gif'||$_FILES['file']['type']=='image/png'||$_FILES['file']['size']>13333337){
move_uploaded_file($_FILES['file']['tmp_name'],'./images/'.$_FILES['file']['name']);
echo 'The file is located <a href="./images/'.$_FILES['file']['name'].'">Here</a>';
}elseif(file_exists('./'.$_FILES['file']['name'])){
echo 'This file already exists; Please upload another';
}else{
echo 'Incorrect file type; Must be a GIF or PNG image';
}
}else{
'There was an error with your upload; '.$_FILES['file']['error'];
}
?>
That's the code I have for uploading, but how do I rename the files after they are uploaded and before I move them?