Upload multiple images with PHP
<?php
/**
* Smart Image Uploader by @cafewebmaster.com
* Free for private use
* Please support us with donations or backlink
*/
$upload_image_limit = 5; // How many images you want to upload at once?
$upload_dir = ""; // default script location, use relative or absolute path
################################# UPLOAD IMAGES
foreach($_FILES as $k => $v){
$img_type = "";
### $htmo .= "$k => $v<hr />"; ### print_r($_FILES);
if( !$_FILES[$k]['error'] && preg_match("#^image/#i", $_FILES[$k]['type']) && $_FILES[$k]['size'] < 1000000){
$img_type = ($_FILES[$k]['type'] == "image/jpeg") ? ".jpg" : $img_type ;
$img_type = ($_FILES[$k]['type'] == "image/gif") ? ".gif" : $img_type ;
$img_type = ($_FILES[$k]['type'] == "image/png") ? ".png" : $img_type ;
$img_rname = $_FILES[$k]['name'];
$img_path = $upload_dir.$img_rname;
copy( $_FILES[$k]['tmp_name'], $img_path );
$feedback .= "Image and thumbnail created $img_rname<br />";
}
}
############################### HTML FORM
while($i++ < $upload_image_limit){
$form_img .= '<label>Image '.$i.': </label> <input type="file" name="uplimg'.$i.'"><br />';
}
$htmo .= '
<p>'.$feedback.'</p>
<form method="post" enctype="multipart/form-data">
'.$form_img.' <br />
<input type="submit" value="Upload Images!" style="margin-left: 50px;" />
Powered by <a href="http://cafewebmaster.com">Cafe Webmaster</a>
</form>
';
echo $htmo;
Bookmark/Search this post with
| Attachment | Size |
|---|---|
| Download multiple_image_uploader.zip | 889 bytes |
Tags:
Similar entries
- Smart Multi-Uploader and Thumbnail Creator from GIF/ JPEG/ PNG with PHP
- php
- Redirect a query to multiple search engines with one form and javascript
- Photo Album / Picture Gallery Script with PHP
- need help for customizing PHP-grep files search
- Search in text files recursively with PHP - Grep
- Image watermark with PHP
- Web2 Style CSS Dynamic Menu with Arrows and Background-Images
- Mouseover images with CSS
- Repair all mysql databases-tables with PHP
- Web2 style secure & flexible free php contact form with easy setup
- Web 2.0 Style two Side Background, Dark to Light Effect
- DropDown / Rollover Menu with pure CSS / HTML
- Pure CSS Mouseover Menu without Javascript
- howto cp images, mp3 from multiple directory to one directory (find, exec, cp)
- Preload images with JavaScript or CSS
- Prevent hotlinking with htaccess and mod_rewrite
- Common HTML / Web colors
- Date, Time, IP Address and browser type for contact form

Comments
I like image watertank with
I like image watertank with php.
hi
this was good and simple....
thanks...
I want to add a folder full
I want to add a folder full images with one click and no-javascript and flash. Or at least using one of them but not both. I wonder if this is possible.
Post new comment