I think this everything your asking for. Thanks for the link. Ill check it out soon as I get a chance. Problem with me learning php is we had severe attacks, header injections about a year ago with an old programmer. Then we hired someone make forms more secure which is what you see here. It seems to work so far, but we cant get eps or pdf files to upload.
//delete file
unlink($file_Temp);
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Max file size is 500kb. Please enter a valid file.</font></p>");
}
if( $file_Mime_Type != "" AND $file_Mime_Type != "application/msword" AND $file_Mime_Type != "application/postscript" AND $file_Mime_Type != "application/vnd.ms-publisher" AND $file_Mime_Type != "image/gif" AND $file_Mime_Type != "image/pjpeg" AND $file_Mime_Type != "image/jpeg" )
{
unlink($file_Temp);
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid file. jpg gif doc pub and eps</font></p>");
}
//Find the extension to the uploaded file
function findexts ($file_Name)
{
$file_Name = strtolower($file_Name) ;
$exts = split("[/\\.]", $file_Name) ;
$n = count($exts)-1;
$exts = $exts[$n];
return $exts;
}
//This applies the function to our file
$ext = findexts ($_FILES['file']['name']) ;
//This line assigns a random number to a variable
$ran = rand () ;
//This takes the random name
$ran2 = $ran.".";