My form works great but I can't get the user submitted images to save to my server or display in the email that I receive once form is submitted. What is wrong here:
Code:
$allowed_extensions = array("jpg", "jpeg", "gif", "bmp", "png");
//Get the uploaded file information
$name_of_uploaded_file = basename($_FILES['photo']['name']);
//get the file extension of the file
$type_of_uploaded_file = substr($name_of_uploaded_file, strrpos($name_of_uploaded_file, '.') + 1);
$size_of_uploaded_file = $_FILES["photo"]["size"]/1024;//size in KBs
//copy the temp. uploaded file to uploads folder
$path_of_uploaded_file = $_SERVER['DOCUMENT_ROOT'] .'/' . $name_of_uploaded_file;
$tmp_path = $_FILES["photo"]["tmp_name"];
if(is_uploaded_file($tmp_path))
{
if(!copy($tmp_path,$path_of_uploaded_file))
{
$errors .= '\n error while copying the uploaded file';
}
}