0

i am trying to do multiple photo upload but its not working,i can just upload just one image at a time
here is my code.I am looking for uploading multiple image using multiple file input type and a single submit button.

<html>
<body>
<form action="imgupsuc.php" method="post" enctype="multipart/form-data">
<?php
    @$nm=$_POST['n1'];
?>
<input type=hidden name=n1  value=<?php echo $nm ?>>
Select a picture<input type="file" name="file" size="50">
Select a picture<input type="file" name="file" size="50"><input type="submit" value="upload">

</form>
</body>
</html>

imgupsuc.php

<?php
    session_start();
    include "connect.php";
?>
<?php
    $name=$_POST['n1'];
    move_uploaded_file($_FILES['file']['tmp_name'],"./pic/".$_SESSION['userid']."".$_FILES['file']['name']);
    $q="insert into image values('".$name."','".$_SESSION['userid']."".$_FILES['file']['name']."','".$_SESSION['userid']."')";
    $s=mysql_query($q);
    if($s>0)
        echo "<h1> pic insert successfully";
    mysql_close();
?><li>Go Back to Choose another photo to upload</li><b>or</b>
<a href="view.php">View Album</a>Or <a href="fileup.php"> Upload Another Image</a>
3
Contributors
2
Replies
14
Views
3 Years
Discussion Span
Last Post by davidjennings
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.