unistake Posted October 25, 2010 Share Posted October 25, 2010 Hi all, I am trying to add 3 images to a file on the server. The form is posted to a php page where I am trying to put the images in to a folder named aircraft. I have tried echoing the values and they are correct. But it is not working for some reason. Any help will be appreciated. The html form is: <li> <label for="image">Main Image</label> <fieldset id="image1"> <input type="file" name="image" id="image" /> </fieldset> <label for="image2">Second Image</label> <fieldset id="image 2"> <input type="file" name="image2" id="image2" /> </fieldset> <label for="image3">Third Image</label> <fieldset id="image 3"> <input type="file" name="image3" id="image3" /> </fieldset> </li> The PHP page is: <?php $destination='aircraft/'.$reg."1.jpg"; $temp_file = $_FILES['image']['tmp_name']; move_uploaded_file($temp_file,$destination); $destination2='aircraft/'.$reg."2.jpg"; $temp_file2 = $_FILES['image2']['tmp_name']; move_uploaded_file($temp_file2,$destination2); $destination3='aircraft/'.$reg."3.jpg"; $temp_file3 = $_FILES['image3']['tmp_name']; move_uploaded_file($temp_file3,$destination3); ?> Link to comment https://forums.phpfreaks.com/topic/216818-adding-images-to-a-file/ Share on other sites More sharing options...
unistake Posted October 25, 2010 Author Share Posted October 25, 2010 Ah, I did not add "enctype="multipart/form-data"" to the top of the form! Link to comment https://forums.phpfreaks.com/topic/216818-adding-images-to-a-file/#findComment-1126392 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.