Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-18-2012, 07:14 PM   PM User | #1
mathruD
New Coder

 
Join Date: Apr 2011
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
mathruD is an unknown quantity at this point
[an error occurred while processing this directive] - only happens on large form

I have a form that contains an album of photos. The photos are pulled from the database depending on which album is selected. Each photo has a checkbox. The user selects the desired photo and then presses submit. When the user presses submit, the checked boxes are sent to another page for processing. So far this works fine for most albums, with the largest working album around 100 photos, but there is one album that has 262 photos. If a user tries to submit the form from the large album, I get this error:

[an error occurred while processing this directive]

Any clue what that might be, and why it only happens with the larger album? I tried searching around and I've already tried switching the ipconfig file to FastCGI, but that didn't work. I'm not sure what else to try, as I have no clue what is causing the error.
mathruD is offline   Reply With Quote
Old 07-18-2012, 08:30 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I assume you're not actually sending back 262 photos for a request? If so, cut it down to 1. All you need to know is the album to do anything with it, as you can seek the data you require with just that information.

That doesn't appear to be a PHP error. That looks like a status 500 possibly from an IIS server? These typically occur before the PHP processing starts, but if its IIS I can't be sure as I've never used it with PHP before.
Fou-Lu is offline   Reply With Quote
Old 07-18-2012, 08:53 PM   PM User | #3
mathruD
New Coder

 
Join Date: Apr 2011
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
mathruD is an unknown quantity at this point
Each photo has a checkbox. Once that checkbox is checked, a div, containing numerous select menus, toggles to show. The numerous select menus are for choosing a quantity of various sized prints of that pic (e.g. 4"x6", 5"x7", etc.).

With the way I'm processing the form now, the do/while loop is running through the photos where the album equals the album_id. It is checking each pic to see if all of the select boxes are left blank. If at least one of the select menus has been changed, it processes that info.

Am I going about that the wrong way. Sorry if that is still vague. I've never made a form quite this extensive before.
mathruD is offline   Reply With Quote
Old 07-18-2012, 10:14 PM   PM User | #4
mathruD
New Coder

 
Join Date: Apr 2011
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
mathruD is an unknown quantity at this point
I also tried directing the form to a blank page just to see if maybe it's the form, itself, causing the problem, and not the processing. When sending to a blank page, I still get the error so I can only assume it's the size of the form that is causing the problem. Could there be some type of timeout or file limit that is causing it?
mathruD is offline   Reply With Quote
Old 07-18-2012, 10:29 PM   PM User | #5
mathruD
New Coder

 
Join Date: Apr 2011
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
mathruD is an unknown quantity at this point
I figured out the issue when I checked the error log in cpanel. It said this:

[18-Jul-2012 11:10:27] PHP Fatal error: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0

My form was submitting over 1000 variables. So I had to go into the max_input_vars and set it to a higher number. It works now.

I know it probably isn't a good idea to have that many variables in a form. I probably should have used an array. That was the first time I've coding a form that involved that much content, though, so I know how to adjust it.

Last edited by mathruD; 07-18-2012 at 11:51 PM..
mathruD is offline   Reply With Quote
Reply

Bookmarks

Tags
directive, error, form, php, submit

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:22 PM.


Advertisement
Log in to turn off these ads.