Originally posted by netstu86
use javascript
wow, i went to bed and javascript was a client side language and i've woken up to find it's become server side overnight.....
has php been modded too, can it clean my fridge and do my washing yet, even better felate?
javascript is good for manipulation of form data within the browser window but has no control over anything on the server side of things
rename will help you out when dealing wth stuff already uploaded to the server php.net/remane
looking at your code
$res=copy($HTTP_POST_FILES['userfile']['tmp_name'],$path.
$HTTP_POST_FILES['userfile']['name']);
if you change $HTTP_POST_FILES['userfile']['name'] to $NewFilename, that's the bit that copies the image from the servers temp directory to where you specify.
there's a couple of things to be going on with, am sure someone else here will either back me up, correct me if i'm wrong or offer an answer i've not thought of 😉
hope it helps