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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.