' . "\n"); fclose($fp); // handle each file in the MMS message foreach ($_FILES as $key=>$value) { $strSource = $_FILES[$key]['tmp_name']; $strDestination = $strLocation . $_FILES[$key]['name']; // mack a quick check that the files really did arrive by HTTP POST // note : this is not suitable security for a live environment if (move_uploaded_file($strSource, $strDestination)) { // this file arrived by HTTP POST so add it to the HTML file $fp = fopen($strHTMLFile, 'a+'); // add an appropriate entry based on this file's mimetype // although this basic example only handles jpeg images and 3gpp video, other mimetypes can be handled switch ($_FILES[$key]['type']) { case 'image/jpeg' : fputs($fp, '
' . "\n"); break; case 'video/3gpp' : fputs($fp, '3g video (download)
' . "\n"); break; } fclose($fp); } else { // this file didn't arrive by HTTP POST - possible file upload attack exit(); } } $fp = fopen($strHTMLFile, 'a+'); fputs($fp, '
' . "\n"); fclose($fp); ?>