ok here is a snippet of the script which allows me to upload a image and it will autocreate a thumbnail and save the image into my directory. the script at the moment keeps the original file name when it saves it to the thumbnail location which is this part of the code. $filename = $_FILES['fupload']['name']; now ive added in a simple php function to create a random code like so: $random_number = intval( "0" . rand(1,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9)); but the problem is how to i change the $filename so it changes to the random generate code but also keeps the file extension of the original file.
Think of this though: If I upload an image to your site called this.is.my.image.jpeg, what's going to happen then?