Welcome Guest, Not a member yet? Register   Sign In
No post data with IE6?
#1

[eluser]falloutphil[/eluser]
Hi,

Apache 2.0/PHP5/CI 1.6 - and IE6

I'm a bit baffled by this. I have a simple HTML form in a view's body - nothing else, the controller passes a DB query which is succeeding (verified by looking at rendered HTML source):

<form action="/blah/blah/index.php/mymessages" method="POST" name="myForm">
<?php foreach($query->result() as $row): ?>
<BR>&lt;?=$row->id?&gt;&lt;input type="radio" name="cycle_id" value="x&lt;?=$row-&gt;id?&gt;">
&lt;?php endforeach; ?&gt;
&lt;input type="submit" value="My Messages"&gt;
&lt;/form&gt;

In my mymessages.php if I simply try dumping the post and submitting with a radio selected:

var_dump( $_POST );

I get an empty array on IE6! This works fine on Firefox tho. Attempts to get at the data using CI's methods don't work either.

I've simplified the problem down a lot here - I've tried everything I can think of including vardumping in the Controller base and even the CI_Base - same result.

However if I change my form action to point to some PHP script outside of CI, it works fine in IE6 too - i.e. some /test.php which is just &lt;?php var_dump($_POST) ?&gt;

I've tried removing all my .htaccess settings in case this was the problem (hence the un-pretty name specified in my action above), still can't get this to work.

Weirdly if I refresh very quickly after posting, *sometimes* the data is appears, a second refresh sees it disappear again....

This has me stumped. Has anyone else seen similar behaviour, or could someone confirm they've had forms working in IE6 like this?

Any help greatly appreicated - if I can't get this to work in IE it's a real dealbreaker for me,

thanks,

Phil.
#2

[eluser]falloutphil[/eluser]
Hmm - I've download 1.6.1 and the problem doesn't *seem* to be present here.

That means - either it was fixed in this release OR it's my bad, and I still can't spot it.

I'm still interested to know how such weird behaviour could be seen - if anyone can offer up and explanation I'd be most interested to hear!

Phil.
#3

[eluser]falloutphil[/eluser]
I'm a bit closer to working out what is wrong.

Basically it comes down to Apache's config. I had two things in my .htaccess file:

authentication using the Windows SSPI mod
Rewrite stuff as per Code Igniter user guide.

It would appear that if I stick these in the htaccess file, IE6 does not like it. It's OK with a blank htaccess file, but as soon as you make it do anything it start to behave strangely when forms are posted.

Stranger still if you remove the htaccess file and even restart Apache the original affects linger on!!!! I found myself renaming my document root to make it load properly!

So... I tried whacking the config in my httpd.conf. Some success here, but it's dodgy stuff. The SSPI mod seems to anger Coder Igniter too. I find that if you stick it in the conf file and restart, my form posts start failing..... but, if I then change code igniter root all is well.

I tried the same thing with Rewrite, but this was much more stubborn - not least because if I stick a rewrite in my conf it's hard coded so I cannot then move the directory in some bizzare attempt to make it work:

<Directory "C:/source/cafbuilder/web17">
RewriteEngine On
RewriteCond $1 !^(index\.php|images|stylesheets|javascript)
RewriteRule ^(.*)$ /cafbuilder/web17/index.php/$1 [L]
</Directory>

There's probably a way to write a generic one that I plonk it the code igniter parent directory that doesn't hard code the directory:

<Directory "C:/source/cafbuilder/">
RewriteEngine On
RewriteCond $1 !^(index\.php|images|stylesheets|javascript)
RewriteRule ^(.*)$ /cafbuilder/<SOMETHING MAGICAL>/index.php/$1 [L]
</Directory>

If anyone has any ideas how to do this?



So in summary CI 1.6.1 + .htaccess + rewrites and/or SSPI doesn't behave well on IE6 when posting forms!

I'm not going to even try to comment why this might be - but it would appear that the form information is getting trampled somewhere - at least that is what the symptoms suggest.
#4

[eluser]falloutphil[/eluser]
OK - last word on this - I've convinced myself with a few more tests.

Code Igniter 1.6.1 will not POST form data in a correct and consistent manner with mod_auth_sspi 1.0.4 / Apache 2.0 when content is viewed in IE6.

To me the rewrite mod looks to suffer from the same problem.

Ultimately it doesn't matter if config is in htaccess or httpd.conf.

The same identical pages work just fine in Firefox.

Strictly speaking this may not be a bug in code igniter, I suppose, but it is an issue.


Hopefully my ramblings will save someone the annoyance I've had over the last 24 hours.

Of course if anyone wants to offer a solution and can confirm that they can get it working - I'm still very keen to hear.

Phil.
#5

[eluser]Unknown[/eluser]
Hi, in your form you need just set :

&lt;form method='post' ACTION = "index.php/controller/action"&gt;

With index.php in action adress everything is working fine....




Theme © iAndrew 2016 - Forum software by © MyBB