Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7505373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:53:22+00:00 2026-05-29T21:53:22+00:00

I have a php form which allows the user to provide a reference number

  • 0

I have a php form which allows the user to provide a reference number and then select a pdf file to upload.

The form has multiple selections and as such I want to be able to upload multiple file with one form.

my form code is as below:

<form enctype="multipart/form-data" method="post" action="capturelocal2.php">
<table id="hor-minimalist-a" border=0>
<tr><th><font color=red><b>Drop 1</b></font></th></tr>
<tr id="r0">
<th valign=bottom>Haulier Delivery #</th>
<th valign=bottom>Hulamin Load # A</th>
<th valign=bottom>Load # A POD</th>
<th valign=bottom>Hulamin Load # B</th>
<th valign=bottom>Load # B POD</th>
<th valign=bottom>Customer</th>
<th valign=bottom>Arrive Time</th>
<th valign=bottom>Depart Time</th>
</tr>
<tr id="r1">
<td valign=bottom  width=50><input type=text name=drop1del id=drop1del size=12></td>
<td valign=bottom  width=50><input type=text name=ref1 id=ref1 size=12></td>
<td valign=bottom  width=50><input type=file size=6 name=ref1pod id=ref1pod></td>
<td valign=bottom  width=50><input type=text name=ref1b id=ref1b size=12></td>
<td valign=bottom  width=50><input type=file size=6 name=ref1bpod id=ref1bpod></td>
<td>
    <SELECT NAME="drop1" id="drop1"  style="width:200px;" > 
    <OPTION VALUE=0>
    <?=$optionscustomers?> 
    </SELECT> 
</td>
<td><input type=text name="drop1arrivedatetime" id="drop1arrivedatetime" size=15><img src="images2/cal.gif" onclick="javascript:NewCssCal ('drop1arrivedatetime','yyyyMMdd','dropdown',true,'24')"  style="cursor:pointer"/></td>
<td><input type=text name="drop1departdatetime" id="drop1departdatetime" size=15><img src="images2/cal.gif" onclick="javascript:NewCssCal ('drop1departdatetime','yyyyMMdd','dropdown',true,'24')"  style="cursor:pointer"/></td>
</tr>
<tr><th><font color=red><b>Drop 2</b></font></th></tr>
<tr id="r2">
<th valign=bottom>Haulier Delivery #</th>
<th valign=bottom>Hulamin Load # A</th>
<th valign=bottom>Load # A POD</th>
<th valign=bottom>Hulamin Load # B</th>
<th valign=bottom>Load # B POD</th>
<th valign=bottom>Customer</th>
<th valign=bottom>Arrive Time</th>
<th valign=bottom>Depart Time</th>
</tr>
<tr>
<tr id="r3">
<td valign=bottom><input type=text name=drop2del id=drop2del size=12></td>
<td valign=bottom  width=50><input type=text name=ref2 id=ref2 size=12></td>
<td valign=bottom  width=50><input type=file size=5 name=ref2pod id=ref2pod></td>
<td valign=bottom  width=50><input type=text name=ref2b id=ref2b size=12></td>
<td valign=bottom  width=50><input type=file size=5 name=ref2bpod id=ref2bpod></td>
<td>
    <SELECT NAME="drop2" id="drop2" style="width:200px;"  > 
    <OPTION VALUE=0>
    <?=$optionscustomers?> 
    </SELECT> 
</td>
<td><input type=text name="drop2arrivedatetime" id="drop2arrivedatetime" size=15><img src="images2/cal.gif" onclick="javascript:NewCssCal ('drop2arrivedatetime','yyyyMMdd','dropdown',true,'24')"  style="cursor:pointer"/></td>
<td><input type=text name="drop2departdatetime" id="drop2departdatetime" size=15><img src="images2/cal.gif" onclick="javascript:NewCssCal ('drop2departdatetime','yyyyMMdd','dropdown',true,'24')"  style="cursor:pointer"/></td>
</tr>
    </table>
    </form>

My PHP Code to process the form is:

    $ref1 = $_POST[ref1];
    $ref1pod = $_POST[ref1pod];
    $ref1bpod = $_POST[ref1bpod];
    $ref2 = $_POST[ref2];
    $ref2pod = $_POST[ref2pod];
    $ref2bpod = $_POST[ref2bpod];

    if (isset(ref1pod) || ($_FILES["ref1pod"]["type"] == "application/pdf")
      || ($_FILES["ref1pod"]["type"] == "image/jpeg")
      && ($_FILES["ref1pod"]["size"] < 50000))
      {
      move_uploaded_file($_FILES["ref1pod"]["tmp_name"],
        "/home/hulaminyxr/public_html/pod/" . ($ref1pod.".pdf"));
        echo "POD Successfully uploaded for delivery $ref1pod:<br><br>"; 
        }

    if (isset($ref1bpod) ||($_FILES["ref1bpod"]["type"] == "application/pdf")
      || ($_FILES["ref1bpod"]["type"] == "image/jpeg")
      && ($_FILES["ref1bpod"]["size"] < 50000))
      {
      move_uploaded_file($_FILES["ref1bpod"]["tmp_name"],
        "/home/hulaminyxr/public_html/pod/" . ($ref1bpod.".pdf"));
        echo "POD Successfully uploaded for delivery $ref1bpod:<br><br>"; 
    }

 if (isset(ref2pod) || ($_FILES["ref2pod"]["type"] == "application/pdf")
      || ($_FILES["ref2pod"]["type"] == "image/jpeg")
      && ($_FILES["ref2pod"]["size"] < 50000))
      {
      move_uploaded_file($_FILES["ref2pod"]["tmp_name"],
        "/home/hulaminyxr/public_html/pod/" . ($ref2.".pdf"));
        echo "POD Successfully uploaded for delivery $ref2:<br><br>"; 
        }

    if (isset($ref2bpod) ||($_FILES["ref2bpod"]["type"] == "application/pdf")
      || ($_FILES["ref2bpod"]["type"] == "image/jpeg")
      && ($_FILES["ref2bpod"]["size"] < 50000))
      {
      move_uploaded_file($_FILES["ref2bpod"]["tmp_name"],
        "/home/hulaminyxr/public_html/pod/" . ($ref2b.".pdf"));
        echo "POD Successfully uploaded for delivery $ref2bpod:<br><br>"; 
    }  


    echo "<br><br>All files uploaded successfully";

Currently, on submitting the form the pdf file is not being uploaded correctly? is my code correct or is this not possible with multiple files?

In addition, I have 10 rows in the form, I have only provided the code for 1 row, is there a more efficient way to uplaod mutiple selected files?

Thanks,
Ryan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:53:23+00:00Added an answer on May 29, 2026 at 9:53 pm
    1. It is possible to upload multiple files. Please read the PHP manual for uploading multiple files
    2. If your code is not working please explain what is the problem.
    3. Your code is saving jpeg files as pdf. See my comments below:

      # If file type is "pdf" or "jpeg" save it...
      if (isset(ref1pod) || ($_FILES["ref1pod"]["type"] == "application/pdf")
            || ($_FILES["ref1pod"]["type"] == "image/jpeg")
            && ($_FILES["ref1pod"]["size"] < 50000))
            {
      
        # .. with .pdf extension
        move_uploaded_file($_FILES["ref1pod"]["tmp_name"],
          "/home/hulaminyxr/public_html/pod/" . ($ref1pod.".pdf"));
      

      `

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following form which allows a user to select dates/rooms for a
i have a form which allows the user to upload some files to a
I have a form which has two inputs. The first input allows a user
I have a php file that contains a form (which contains 2 input boxes
I have a php form that has a known number of columns (ex. top
I have two .php files which show all contacts in a database, then allows
I have a PHP web application running on IIS, which allows a user to
I have a PHP form which includes a file being uploaded upon submit. As
I've put together a PHP script and small form which allows the user to
Language: PHP I have a form which asks users for their educational details, course

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.