Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

cannot upload images

images php coding issues or problems here.

Moderators: macek, egami, gesf

cannot upload images

Postby jeffsss » Mon Mar 12, 2012 3:49 pm

hi i have problem upload image to server.

my form code as below:
<form enctype="multipart/form-data" action="upload_image.php" method="POST">
<label for="file[]">Image 1: </label><input type="file" name="file[]" id="file[]" />
<br / >
<label for="file[]">Image 2: </label><input type="file" name="file[]" id="file[]" />
<br / >
<input type="submit" value="Upload" />
</form>

then my upload_image.php coding as below:
<?php
move_uploaded_file( $_FILES["file"]["name"][0], "upload/" . $_FILES["file"]["name"][0]);
move_uploaded_file( $_FILES["file"]["name"][1], "upload/" . $_FILES["file"]["name"][1]);
?>

But when i trying to upload images, nothing happen and no image being uploaded to server. Please help to find where went wrong on my scripts.

Thanks a lot.
jeffsss
New php-forum User
New php-forum User
 
Posts: 3
Joined: Thu Mar 01, 2012 4:48 pm

Return to PHP coding => Images

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.