/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Odd behavior with $_POST and IE

Hi guys,

I’m using IE6 (company standard here), and we’re running PHP 5.2.4 and Apache2.2 on a Windows 2003 server.

The code below when using “post” doesn’t always work…that is, if I click too fast. If I wait a few seconds and click slow, it works fine. Otherwise, I’ll get a blank screen and the post variables are non-existent. When I use “get” it works fine no matter how fast I click. Seems very odd. As you can see, I have a couple of variations using onclick to both call a function to submit the form and using it directly to submit the form. I’ve tried using onmouseup/down and had the same results.

Any ideas? I am completely stumped. Also, please ignore the nastiness of the code below…I had to strip it down to something a little less revealing so that my boss can sleep tonight. :p

[code]
<html>
<head>
<title>Selection List</title>
<style type=”text/css”>
.f1 { font-size:7.5pt; font-family: arial,sans-serif; }
.f2 { font-size:10pt; font-family: arial,sans-serif; }
</style>
<script type=”text/javascript”>
function GetInfo(x) {
document.forms[x].submit();
}
</script>
</head>
<body>
<br />
<span class=”f2″><b>Click Client to View Statistics</b></span><br />
<br />
<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”80%”>
<tr>
<td align=”left” width=”10%”><span class=”f1″><b><u>Client ID</u></b></span></td>
<td align=”left” width=”36%”><span class=”f1″><b><u>Description</u></b></span></td>
<td align=”center” width=”5%”><span class=”f1″><b><u>Contact</u></b></span></td>
<td align=”center” width=”5%”><span class=”f1″><b><u>Contact 2</u></b></span></td>
<td align=”center” width=”7%”><span class=”f1″><b><u>Open Date</u></b></span></td>
<td align=”center” width=”7%”><span class=”f1″><b><u>Close Date</u></b></span></td>
<td align=”right” width=”10%”><span class=”f1″><b><u>Current Chg.</u></b></span></td>
<td align=”right” width=”10%”><span class=”f1″><b><u>Current Bal.</u></b></span></td>
<td align=”right” width=”10%”><span class=”f1″><b><u>Util %</u></b></span></td>
</tr>
<tr height=”1″>
<td colspan=”9″>
<form target=”_blank” id=”formMT1″ name=”x1″ method=”post” action=”get_report.php”>
<input type=”hidden” name=”x” value=”010124-0101″ />
<input type=”hidden” name=”rd” value=”rd_B” />
<input type=”hidden” name=”list_A” value=”0″ />
<input type=”hidden” name=”rd1″ value=”ct” />
<input type=”hidden” name=”a1″ value=”02/01/2008″ />
<input type=”hidden” name=”a2″ value=”09/30/2008″ />
</form>
</td>
</tr>
<tr valign=”top” onclick=”GetInfo(‘formMT1’);” style=”cursor: pointer;” onmouseover=”this.bgColor=’0099cc'” onmouseout=”this.bgColor=’white'”>
<td align=”left” width=”10%”><span class=”f1″>010124-0101</span></td>
<td align=”left” width=”36%”><span class=”f1″>GENERAL</span></td>
<td align=”center” width=”5%”><span class=”f1″>JPCO</span></td>
<td align=”center” width=”5%”><span class=”f1″>CFG</span></td>
<td align=”center” width=”7%”><span class=”f1″>07/05/1990</span></td>
<td align=”center” width=”7%”></td>
<td align=”right” width=”10%”><span class=”f1″>6,484.29</span></td>
<td align=”right” width=”10%”><span class=”f1″>113.20</span></td>
<td align=”right” width=”10%”><span class=”f1″>77.5</span></td>
</tr>

<tr height=”1″>
<td colspan=”9″>
<form target=”_blank” id=”formMT2″ name=”x2″ method=”post” action=”get_report.php”>
<input type=”hidden” name=”x” value=”010124-0102″ />
<input type=”hidden” name=”rd” value=”rd_B” />
<input type=”hidden” name=”list_A” value=”0″ />
<input type=”hidden” name=”rd1″ value=”ct” />
<input type=”hidden” name=”a1″ value=”02/01/2008″ />
<input type=”hidden” name=”a2″ value=”09/30/2008″ />
</form>
</td>
</tr>
<tr valign=”top” bgcolor=”#D3D3D3″ onclick=”javascript: document.forms.formMT2.submit();” style=”cursor: pointer;” onmouseover=”this.bgColor=’0099cc'” onmouseout=”this.bgColor=’#d3d3d3′”>
<td align=”left” width=”10%”><span class=”f1″>010124-0102</span></td>
<td align=”left” width=”36%”><span class=”f1″>TECHNOLOGY</span></td>
<td align=”center” width=”5%”><span class=”f1″>JPCO</span></td>
<td align=”center” width=”5%”><span class=”f1″>JDM</span></td>
<td align=”center” width=”7%”><span class=”f1″>01/31/1985</span></td>
<td align=”center” width=”7%”><span class=”f1″>01/21/1997</span></td>
<td align=”right” width=”10%”><span class=”f1″>0.00</span></td>
<td align=”right” width=”10%”><span class=”f1″>0.00</span></td>
<td align=”right” width=”10%”><span class=”f1″>0.0</span></td>
</tr>

<tr height=”1″>
<td colspan=”9″>
<form target=”_blank” id=”formMT3″ name=”x3″ method=”post” action=”get_report.php”>
<input type=”hidden” name=”x” value=”010124-0103″ />
<input type=”hidden” name=”rd” value=”rd_B” />
<input type=”hidden” name=”list_A” value=”0″ />
<input type=”hidden” name=”rd1″ value=”ct” />
<input type=”hidden” name=”a1″ value=”02/01/2008″ />
<input type=”hidden” name=”a2″ value=”09/30/2008″ />
</form>
</td>
</tr>
<tr valign=”top” onclick=”GetInfo(‘formMT3’);” style=”cursor: pointer;” onmouseover=”this.bgColor=’0099cc'” onmouseout=”this.bgColor=’white'”>
<td align=”left” width=”10%”><span class=”f1″>010124-0103</span></td>
<td align=”left” width=”36%”><span class=”f1″>JOINT VENTURE</span></td>
<td align=”center” width=”5%”><span class=”f1″>JPCO</span></td>
<td align=”center” width=”5%”><span class=”f1″>JDM</span></td>
<td align=”center” width=”7%”><span class=”f1″>01/31/1985</span></td>
<td align=”center” width=”7%”><span class=”f1″>01/01/1990</span></td>
<td align=”right” width=”10%”><span class=”f1″>0.00</span></td>
<td align=”right” width=”10%”><span class=”f1″>0.00</span></td>
<td align=”right” width=”10%”><span class=”f1″>0.0</span></td>
</tr>

<tr height=”1″>
<td colspan=”9″>
<form target=”_blank” id=”formMT4″ name=”x4″ method=”post” action=”get_report.php”>
<input type=”hidden” name=”x” value=”010124-0104″ />
<input type=”hidden” name=”rd” value=”rd_B” />
<input type=”hidden” name=”list_A” value=”0″ />
<input type=”hidden” name=”rd1″ value=”ct” />
<input type=”hidden” name=”a1″ value=”02/01/2008″ />
<input type=”hidden” name=”a2″ value=”09/30/2008″ />
</form>
</td>
</tr>
<tr valign=”top” bgcolor=”#D3D3D3″ onclick=”javascript: document.forms.formMT4.submit();” style= “cursor: pointer;” onmouseover=”this.bgColor=’0099cc'” onmouseout=”this.bgColor=’#d3d3d3′”>
<td align=”left” width=”10%”><span class=”f1″>010124-0104</span></td>
<td align=”left” width=”36%”><span class=”f1″>IMAGING CENTER</span></td>
<td align=”center” width=”5%”><span class=”f1″>JPCO</span></td>
<td align=”center” width=”5%”><span class=”f1″>JDM</span></td>
<td align=”center” width=”7%”><span class=”f1″>01/31/1985</span></td>
<td align=”center” width=”7%”><span class=”f1″>01/01/1990</span></td>
<td align=”right” width=”10%”><span class=”f1″>0.00</span></td>
<td align=”right” width=”10%”><span class=”f1″>0.00</span></td>
<td align=”right” width=”10%”><span class=”f1″>0.0</span></td>
</tr>
</table>
</body>
</html>

[/code]

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@ariellOct 04.2008 — This sounds, indeed, very odd.

Usually, since this is client stuff, I am pretty careful with ideas. Anyways: I GUESS that IE (in particular those older versions) hasn't finished loading the form when you click/hit whatever. So, maybe you "start" your form invisible (style) and change this attribute to "visible" with a small JS when the "body-onload" event is fired?

At least, that way you can be sure that the entire form (and data) are loaded, and even an older IE release should be able to handle that.

Just an idea...?
Copy linkTweet thisAlerts:
@sansenOct 04.2008 — I think it is a caching issue , try to disable any caching activity either on server or IE.
Copy linkTweet thisAlerts:
@BrainDonorauthorOct 04.2008 — This sounds, indeed, very odd.

Usually, since this is client stuff, I am pretty careful with ideas. Anyways: I GUESS that IE (in particular those older versions) hasn't finished loading the form when you click/hit whatever. So, maybe you "start" your form invisible (style) and change this attribute to "visible" with a small JS when the "body-onload" event is fired?

At least, that way you can be sure that the entire form (and data) are loaded, and even an older IE release should be able to handle that.

Just an idea...?[/QUOTE]


I can leave the page open for 5 minutes and have the same results. I'm sure it was loaded by then. Thanks for the suggestion though. ?
Copy linkTweet thisAlerts:
@BrainDonorauthorOct 04.2008 — I think it is a caching issue , try to disable any caching activity either on server or IE.[/QUOTE]

Clicking the same row over and over has varying results. If I click it slow, it's fine, too fast and it doesn't work. It's maddening.
Copy linkTweet thisAlerts:
@BrainDonorauthorOct 15.2008 — Well, it was an Apache setting that was causing this.

KeepAliveTimeout was set to 5. I reset to 1 and everything is working perfectly.
×

Success!

Help @BrainDonor spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...