I am new to using php and html and am wondering if someone can tell me where I am going wrong in my code. I am trying to upload a mp4 movie(don’t know if that is the problem) and that portion of the form is always coming back as being empty. The videos are located in the same directory as my php code.
HTML code
<input type = 'file' name = 'sonogram'/>
PHP code
Codefunction addImage($studyId)
{
//check to make sure they have uploaded a sonogram
if(!empty($_FILES['sonogram']))
$sonogram = $_FILES['sonogram'];
else
echo "BADDD";
//call our embedded procedure to add the video to the database
mysql_query("call SaveImage($studyId, $sonogram)");
mysql_error();
}
Any help would be greatly appreciated there is a ton of code associated with this form so I am only posting the relevant portion. I have multiple check boxes and text boxes in the same form and they are all submitting correctly so I am pretty sure the problem lies with the “file” portion
For your form Set:
Hope it helps