Strange HTTP_POST_VARS issues
Posted: Fri Apr 09, 2004 10:15 am
I have something I just want to run by everyone, to see if you have any suggestions, or if anybody has run into this:
I'm writing a basic web-based control panel application, using a lot of buttons for navigation. So, on many pages there are several submit buttons in one form tag, all with the same name (for example, lets say "op"), with different values, so that I can check what $HTTP_POST_VARS[op] equals, and run the appropriate function.
Anyway, I got all this working, or so I thought. I gave it to some users to try out, and they were complaining that sometimes when they click on buttions, nothing happens. The same page reloads, but whatever tool was supposed to open doesn't. After debugging further, I found that if I wait several seconds (seems like 20 always works) and click any button on any page, nothing indeed happened consistently.
So, I added some code to all my .php files, to assist me in debugging this problem:
Again, I tried running through everything, things are working, but then I waited 20 seconds and clicked a button. Nothing happened, which is what I've found, then I took a look at my source in order to see the debug output:
Of course, when things work, I get something like:
So, sometimes, even though I just clicked on a submit button, which obviously tried to post back something or the page wouldn't have refreshed, PHP isn't seeing anything posted back!!
I'm completely confused at this point, and I'm not sure what else I can do. I'm hoping somebody has run into this before.
I'm writing a basic web-based control panel application, using a lot of buttons for navigation. So, on many pages there are several submit buttons in one form tag, all with the same name (for example, lets say "op"), with different values, so that I can check what $HTTP_POST_VARS[op] equals, and run the appropriate function.
Anyway, I got all this working, or so I thought. I gave it to some users to try out, and they were complaining that sometimes when they click on buttions, nothing happens. The same page reloads, but whatever tool was supposed to open doesn't. After debugging further, I found that if I wait several seconds (seems like 20 always works) and click any button on any page, nothing indeed happened consistently.
So, I added some code to all my .php files, to assist me in debugging this problem:
Code: Select all
echo "\n\n<!-- HTTP_POSTVAR INFORMATION:\n";
foreach($HTTP_POST_VARS as $k => $v) {
echo $k;
echo " == ";
echo $v;
echo "\n";
}
echo "--------------------->\n\n";Code: Select all
<!-- HTTP_POSTVAR INFORMATION:
--------------------->Code: Select all
<!-- HTTP_POSTVAR INFORMATION:
op == Manage Service
service == 3300
--------------------->I'm completely confused at this point, and I'm not sure what else I can do. I'm hoping somebody has run into this before.