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 8923793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:13:45+00:00 2026-06-15T07:13:45+00:00

It should be a multiple upload form for pictures I get the HTML Code

  • 0

It should be a multiple upload form for pictures

I get the HTML Code for a Upload-Form:

<form action="upload.php" method="post" id="uploadform" name="uploadform" enctype="multipart/form-data">  
        <label id="filelabel" for="fileselect">Choose the Pictures</label>
        <input type="file" id="fileselect" class="fileuplaod" name="uploads[]" multiple />
        <span class="text">Exist Album</span><br />
        <select id="existAlbum" name="existAlbum" size="1">
            <option value="noAlbum">SELECT ALBUM</option>       
        </select>
        <span class="text">OR</span>
        <span class="text">New Album</span><br />
        <input id="newAlbum" name="newAlbum" type="text" maxlength="20" placeholder="ALBUM NAME"/>
        <input type="submit">
    </form> 

The form link to the uploaded.php. But there i get:

Notice: Undefined index: existAlbum in E:\xampp\htdocs\fotokurs\upload\upload.php on line 11

Notice: Undefined index: newAlbum in E:\xampp\htdocs\fotokurs\upload\upload.php on line 12

Here’s the upload.php:

<?PHP  
$allowedExtensions = array('png', 'jpg', 'jpeg'); 

$maxSize = 20971520;  

$i = 0;  

$first = 0;

$exist_album = $_POST['existAlbum']; 
$new_album = $_POST['newAlbum'];

Where is my fault? I can’t find it…

EDIT
Add following to my code:

if( isset( $_POST['existAlbum'] ) or isset( $_POST['newAlbum'] ) ){
    $exist_album = $_POST['existAlbum']; 
    $new_album = $_POST['newAlbum'];
}else{
    echo 'no album <br />';
}
print_r($_POST);

new output:

no album 
Array ( ) 
Notice: Undefined variable: new_album in E:\xampp\htdocs\fotokurs\upload\upload.php on line 20

Notice: Undefined variable: exist_album in E:\xampp\htdocs\fotokurs\upload\upload.php on line 21

Notice: Undefined variable: new_album in E:\xampp\htdocs\fotokurs\upload\upload.php on line 22

Notice: Undefined variable: exist_album in E:\xampp\htdocs\fotokurs\upload\upload.php on line 23
  • 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-06-15T07:13:46+00:00Added an answer on June 15, 2026 at 7:13 am

    One of your issues is that existAlbum has no actual values associated with it.

    You have <option>Select Album</option> which has no value associated with the option element. If there is no value associated, the select element is not posted to the server. You should change it to be:

    <option value="">Select Album</option>

    EDIT

    Since the user only has to supply one or the other, you should use the following to set your variables:

    $existsAlbum = (isset($_POST['existAlbum']) && !empty($_POST['existAlbum'])) ? $_POST['existAlbum'] : 'defaultValue';
    $newAlbum = (isset($_POST['newAlbum']) && !empty($_POST['newAlbum'])) ? $_POST['newAlbum'] : 'defaultValue';
    

    One important thing to note is that Internet Explorer does not support the placeholder attribute.

    EDIT 2

    Here is my quick test page that worked test.php:

      <form action="upload.php" method="post" id="uploadform" name="uploadform" enctype="multipart/form-data">  
        <label id="filelabel" for="fileselect">Choose the Pictures</label>
        <input type="file" id="fileselect" class="fileuplaod" name="uploads[]" multiple />
        <span class="text">Exist Album</span><br />
        <select id="existAlbum" name="existAlbum" size="1">
          <option value="noAlbum">SELECT ALBUM</option>       
        </select>
        <span class="text">OR</span>
        <span class="text">New Album</span><br />
        <input id="newAlbum" name="newAlbum" type="text" maxlength="20" placeholder="ALBUM NAME"/>
        <input type="submit" value="Submit">
      </form> 
    

    upload.php

        <pre>
    <?php print_r($_POST); ?>
    <?php print_r($_FILES); ?>
        </pre>
    

    results

    Array
    (
        [existAlbum] => noAlbum
        [newAlbum] => 
    )
    Array
    (
        [uploads] => Array
            (
                //Contents here
            )
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to emulate the multiple upload files in html form that looks
I have some code that sends multiple ASIHTTPRequests to upload and download data in
The plugin should allow delete the uploaded file and multiple file upload. EDIT: Actually
I've got a simple upload form to allow for multiple uploads, and for each
I am currently trying to communicate a parent process which should have multiple children
How should I map multiple columns with List in IBATIS ? I have a
I'm working on a game where multiple players should be able to play at
The Celery docs section Performance and Strategies suggests that tasks with multiple 'steps' should
How should one ensure correctness when multiple processes access one single SQLite database file?
The situation: I have multiple classes that should each hold a variable with a

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.