Jump to content

adding images to a file


unistake

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.