Hello there, my name is Vinny.
I’m gonna try and be as straightforward as possible.
What I want to do is, when I upload an image, it automatically renames it to “Example 1”, but if “Example 1” already exists, it renames it to “Example 2”, and if “Example 2” exists, it renames it to “Example 3”, so on and so forth.
I’ve little knowledge in PHP, but I have this base script that stores uploaded images in my predefined location.
[php]<?php
$target_path = “images/cars/”;
$target_path = $target_path . basename( $_FILES[‘uploadedfile’][‘name’]);
if(move_uploaded_file($_FILES[‘uploadedfile’][‘tmp_name’], $target_path)) {
echo "The photo(s) “. basename( $_FILES[‘uploadedfile’][‘name’]).
" has been uploaded”;
} else{
echo “There was an error uploading the photo(s), please try again!”;
}
?>[/php]