With this code below could some one please tell me how i could add the file type to the end of the uploaded file when it has been uploaded. I can not just add the original name to the end to do it so i need another way of getting that file extension there.
$img1_rand = rand() % 99999999;
$img1_rand2 = rand() % 99999999;
if (is_uploaded_file($img1)) {
if ($img1_size>$max_size) { echo "The file is too big<br>\n"; exit; }
if (($img1_type=="image/gif") || ($img1_type=="image/pjpeg")) {
if (file_exists($path. $img1_rand . $img1_rand2)) { echo "The file already exists<br>\n"; exit; }
$res = copy($img1, $path . $img1_rand . $img1_rand2);
if (!$res) {
echo " upload failed!<br>\n"; exit; }
else
echo "";
} else { echo " Wrong file type<br>\n"; exit; }
}