Hello, Check this http://lol.com.pk/img/image_upload.php I Need this type of PHP Script. Its Simple PHP Code. Please Help me. I need it. I Shall be very thankful. Thanks Regards
create myimages folder. and save this script "image_upload.php" <!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> <style type="text/css"> <!-- body,td,th { font-family: Tahoma; font-size: 11px; } --> </style> </head> <body> <?php // your upload path end slash $folder = 'myimages/'; if ($_POST['upload']!='') { foreach ($_POST['title'] as $key => $title) { if ($_FILES['file']['error'][$key]==0) { $file = $_FILES['file']; $allowedExtensions = array("jpg","jpeg","gif","png"); if (!in_array(end(explode(".", strtolower($file['name'][$key]))), $allowedExtensions)) { $results .= $file['name'][$key].' - image extenstion error !'; } else { if ($file['size'][$key]>999999){ $results .= $file['name'][$key].' - image file size bigger than 999kb !'; } else { $tmp = preg_replace('/[^a-z0-9._-]/i', '', $file['name'][$key]); $filename = time().strtolower(preg_replace('/\W-/', '', $tmp)); move_uploaded_file($file['tmp_name'][$key], $folder.$filename); $results .= '<img src="http://www.yourimgserver.com/images/'.$filename.'" alt="'.$title.'" title="'.$title.'" style="padding-bottom:10px"/><br><br>'; } } } } ?> <a href="image_upload.php">Click Here To Upload More Pictures</a> <div style="overflow:auto; border:1px solid #EAEAEA; width:800px; padding:2px;"> <div style="background-color:#F3F3F3; border:none; width:100%; min-height:300px;"> <?=$results?> </div> </div> <?php } else { $step = intval($_POST['step']); if ($step==2) { $num = intval($_POST['num']); if ($num<1) { $num = 1; } ?> <form action="" method="post" enctype="multipart/form-data" name="form2"> <table width="66%" border="0" cellspacing="0" cellpadding="0"> <?php for ($i=1; $i<($num+1); $i++) { ?> <tr> <td colspan="2"><h3>Image Number <?=$i?> </h3></td> </tr> <tr> <td width="250"><strong>Title</strong> (Leave Empty If not required) </td> <td width="61%" align="left"><label> <input name="title[]" type="text" id="title[]" /> </label></td> </tr> <tr> <td><strong>Browse</strong></td> <td align="left"><label> <input name="file[]" type="file" id="file[]" /> <input name="num" type="hidden" id="num" value="<?=$i?>" /> </label></td> </tr> <?php } ?> <tr align="left"> <td><label></label></td> <td><br /> <input name="upload" type="submit" id="upload" value=" Upload " /></td> </tr> </table> </form> <?php } else { ?> <form name="form1" method="post" action=""> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <th align="left" scope="col"><h2>Please Enter Number Pictures You Want To Upload </h2></th> </tr> <tr> <th align="left" scope="col"><label> <input name="num" type="text" id="num" /> </label></th> </tr> <tr> <th scope="row"><input name="step" type="hidden" id="step" value="2" /></th> </tr> <tr> <th align="left" scope="row"><label> <input name="continue" type="submit" id="continue" value=" Continue " /> </label></th> </tr> </table> </form> <?php } } ?> </body> </html> PHP:
if need more help, from php developers plz dont hesitate to contact wordpress.com/2011/01/13/introduction-of-the-custome-php-mysql-programming