Results 1 to 1 of 1
-
01-09-2010, 02:37 PM #1
PHP Multiple file upload error???
Code:<?php if (isset($_POST[submit])) { $uploadArray= array(); $uploadArray[] = $_POST['uploadedfile']; $uploadArray[] = $_POST['uploadedfile2']; $uploadArray[] = $_POST['uploadedfile3']; foreach($uploadArray as $file) { $target_path = "upload/"; $target_path = $target_path . basename( $_FILES["$file"]['name']); if(move_uploaded_file($_FILES["$file"]['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES["$file"]['name'])." has been uploaded"; } else { echo "There was an error uploading the file, please try again!"; } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Untitled Document</title> </head> <body> <form enctype="multipart/form-data" action="" method="POST"> <p> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /> </p> <p>Choose a file to upload: <input name="uploadedfile2" type="file" /> </p> <p>Choose a file to upload: <input name="uploadedfile3" type="file" /> <br /> <input name="submit" type="submit" id="submit" value="submit" /> </p> </form> </body> </html>
Similar Threads
-
Selling PHP Matrimonial Script (shaadi.com clone) at www.infocuswebdesigning.com
By ashish10 in forum WebsitesReplies: 3Last Post: 08-13-2011, 06:19 PM -
Speeding PHP Using APC PHP Cache
By HIMMY in forum PHPReplies: 2Last Post: 10-26-2009, 10:49 AM -
PLR MRR many niche : webmaster, seo, clickbank, membership, money, etc
By juanaballerina in forum FreebiesReplies: 0Last Post: 10-22-2009, 01:53 PM -
File upload in php
By krates98 in forum PHPReplies: 1Last Post: 02-25-2009, 11:00 PM -
Php error handling
By krates98 in forum PHPReplies: 1Last Post: 02-25-2009, 10:56 PM





Reply With Quote

