Jump to content

PHP File Upload


MarkT
 Share

Recommended Posts

Hello,

I currently have the following code;

<?PHP require "./system/connect.php" ?><?php  if ($_FILES["file"]["error"] > 0)    {    echo "Return Code: " . $_FILES["file"]["error"] . "<br>";    }  else    {    echo "Upload: " . $_FILES["file"]["name"] . "<br>";    echo "Type: " . $_FILES["file"]["type"] . "<br>";    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";    echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>";$filename = $_FILES["file"]["name"];$title = $_POST['name'];$publisher = $_POST['author'];mysqli_query($con,"INSERT INTO gallery (name,photo,author) VALUES ('{$title}','{$filename}','{$publisher}')");echo "<meta http-equiv='refresh' content='1; url=newgallery.php' />";    if (file_exists("gallery/album/" . $_FILES["file"]["name"]))      {      echo $_FILES["file"]["name"] . " already exists. ";      }    else      {      move_uploaded_file($_FILES["file"]["tmp_name"],      "gallery/album/" . $_FILES["file"]["name"]);      echo "Stored in: " . "gallery/album/" . $_FILES["file"]["name"];      }    }?>

However, I would like the form to have 2 files to be uploaded, how would I embed it?

 

 

Link to comment
Share on other sites

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...