note 40231 added to features.file-upload

From: Date: Thu, 26 Feb 2004 04:29:45 +0000
Subject: note 40231 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-65770@lists.php.net to get a copy of this message
Please help me... I got a upload. here you can see "upload.php".: <?php // Set the upload place, after your document root directory $upload_dir = $_SERVER['DOCUMENT_ROOT'] . "/upload/"; if (isset($_POST[submit])) { // Write as many file upload // inputs as user wanted $file_amount = $_POST['file_amount']; $counter = 1; while ($counter <= $file_amount) { $foto_input .= "$counter. file: <input name='filename[$counter]' type='file'><br />\n"; $counter++; } // Generate an html output // where to display the file // upload fields print "<form enctype='multipart/form-data' action='$PHP_SELF' method='post' name='upload_form'> <table width='100%' border='0' align='center'> <tr><td> <li>Upload path: $upload_dir</li>\n <li>Amount of files to upload: <b>$file_amount</b></li>\n </td></tr>\n <tr><td>$foto_input</td></tr>\n <tr><td><input type='submit' name='upload' value='Upload Files'></td></tr>\n </table>\n </form>\n"; } else { // Generate the form // for user to select how many uploads he // wants to do. print "<form name='gallery_setup' method='post' action='$PHP_SELF'>" . "Number of photos to upload:" . " <input name='file_amount' type='text' id='file_amount' size='10'>" . " <input type='hidden' name='MAX_FILE_SIZE' value='300000000'>" . " <input name='submit' type='submit' id='submit' value='submit'> " . "</form>"; } if (isset($_POST[upload])) { // Get the upload file array // and upload them to a destination // by looping through that array // Get the variables from previous form $up_files = $_FILES['filename']; $counter = 0; // Start the file upload to server while($counter <= count($up_files)) { if($up_files['size'][$counter] > 0) { $filetype = $up_files['type'][$counter]; $filename = $up_files['name'][$counter]; $tempname = $up_files['tmp_name'][$counter]; $upload_file = $upload_dir . $filename; // Upload the files move_uploaded_file($tempname, $upload_file); // Print the uploaded file print "File <b>$filename</b> uploaded... new location: <b>$upload_file</b><br />"; } $counter++; } // End if upload } ?> but i can make it to show the image files. Please how to i make it to i can se in a *.php the images? and how to i make the small? Thanx ---- Manual Page -- http://www.php.net/manual/en/features.file-upload.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40231 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40231&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40231&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#65770) next »