Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2009
    Posts
    62
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Form not posting any data

    Hey all,

    I have a form where i need to upload 2 files. If I only select one file then the form works fine, but if I select a file in both boxes then no data is posted. Below is the code that I am using, any help here would be very much appciated.

    Thanks,

    Code:
    <form action="" method="post" name="client-balances-selection" enctype="multipart/form-data">
    	<div id="current-balances">
    		<h3>Current client balances</h3>
    		<input type="file" name="[file]current_balances" class="file_upload" />
    	</div>
    	<div id="past-balances">
    		<h3>Past client balances</h3>
    		<input type="file" name="[file]past_balances" class="file_upload" />
    	</div>
    	<input type="submit" name="action" class="button-primary" value="<?php _e('Compare'); ?>" />
    	<input type="submit" name="action" class="button-delete" value="<?php _e('Delete old files'); ?>" onclick="return (confirm('Are you sure you wish to delete all client balance files?'));" />
    </form>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    but if I select a file in both boxes then no data is posted
    Put the following at the top of your page and check the result on both the cases.
    PHP Code:
    echo '<pre>';
    print_r($_FILES);
    echo 
    '</pre>'
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Jun 2009
    Posts
    62
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thanks for the reply.

    Same results as before - fine if either one of the inputs is used, but returns an empty array if they are both used.

    Thanks.

  • #4
    New Coder
    Join Date
    Jun 2009
    Posts
    62
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Think I have got it - My php.ini file has 8MB as the maximum file upload size, so I assumed that this meant each file could be up to 8MB in size - turns out it is 8MB total though, so I look to now have this sussed.

    Thanks for the input.

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Think I have got it - My php.ini file has 8MB as the maximum file upload size, so I assumed that this meant each file could be up to 8MB in size - turns out it is 8MB total though, so I look to now have this sussed.
    You should have got the clues from the output of the lines that I've given!
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •