Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP - Upload images to FTP directory and then Display images uploaded only from directory
    primarykey
    data
    text
    <p>i simply want that after i upload an image using form file upload, it will display those images on the next page. The images are uploaded to a folder on the ftp. i have looked everywhere but cant seem to find the right solution.</p> <p>this is the HTML code for uploading image (image.php):</p> <pre><code>&lt;form enctype="multipart/form-data" action="upload.php" method="POST"&gt; &lt;input type="hidden" name="MAX_FILE_SIZE" value="100000" /&gt; Choose a file to upload: &lt;input name="uploadedfile_1" type="file" /&gt;&lt;br /&gt; Choose a file to upload: &lt;input name="uploadedfile_2" type="file" /&gt;&lt;br /&gt; &lt;input type="submit" value="Upload Files" /&gt; &lt;/form&gt; </code></pre> <p>Here's the PHP code on the next page (upload.php):</p> <pre><code>&lt;?php $ftp_server = "localhost"; $ftp_username = "xxx"; $ftp_password = "xxx"; $conn_id = ftp_connect($ftp_server) or die("could not connect to $ftp_server"); if(@ftp_login($conn_id, $ftp_username, $ftp_password)) { echo "connected as $ftp_username@$ftp_server\n"; } else { echo "could not connect as $ftp_username\n"; } $file = $_FILES["uploadedfile_1"]["name"]; $file2 = $_FILES["uploadedfile_2"]["name"]; $remote_file_path = "/2013/img/".$file; $remote_file_path2 = "/2013/img/".$file2; ftp_put($conn_id, $remote_file_path, $_FILES["uploadedfile_1"]["tmp_name"],FTP_ASCII); ftp_put($conn_id, $remote_file_path2, $_FILES["uploadedfile_2"]["tmp_name"],FTP_ASCII); ftp_close($conn_id); echo "\n\nconnection closed"; ?&gt; </code></pre> <p>Above is only the Upload code and I don't know what Php code I need to use for Displaying the images, but typically, I'd like to echo these two images on Upload.php. Is there a way that this code can predict what images were uploaded?</p> <p>Any help would be much appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload