views:

130

answers:

3

I'm developing a web app specifically for mobile phones, and I've run into a doozy of a problem. On the Blackberry emulator I've installed, everything works fine. But when I run my Openwave or Nokia N60 emulators, I can't log into my app any more. When I check the logs, I find that the reason is that ALL of the $_POST variables are empty.

I've run through just about everything I can think of that would be the problem, and I'm still stuck. I've tried all three of the DOCTYPEs that Wikipedia lists, on the off chance that that's it, I've tried sending all kinds of different headers, and I'm just stumped.

My last idea is that perhaps my form code itself is wrong? I enclose a table in my form, and all the examples I've seen enclose a paragraph with the form.

I.e. In the examples I see:

<form>
    <p>
        ... stuff ...
    </p>
</form>

And I have:

<form action="/" method="POST" class="formic">
    <table class="mobile-form">
        <tr>
            <td colspan="2" class="label required">Email address</td>
        </tr>
        <tr>
            <td colspan="2" class="data"><input type="text" name="email" class="text" /></td>
        </tr>
        <tr>
            <td colspan="2" class="label required">Password</td>
        </tr>
        <tr>
            <td><img src="/images/exclamation.png" class="error_icon" value="/images/exclamation.png" /></td>
            <td class="data"><input type="password" name="password" class="text" /></td>
        </tr>
        <tr>
            <td colspan="2" class="data field-error">You must enter a password.</td>
        </tr>
        <tr>
            <td colspan="2" class="label required">Sign in to:</td>
        </tr>
        <tr>
            <td colspan="2" class="data">
                <select name="aspect">
                    <option value="web">Web interface</option>
                    <option selected="selected" value="mobile">Mobile interface</option>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="hidden" name="saved_aspect" value="0" />
                <label>
                    <input type="checkbox" name="saved_aspect" checked="checked" value="1" />
                    Save interface choice on this computer.
                </label>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="submit"><input type="submit" name="" class="submit" value="Log in" /></td>
        </tr>
    </table>
</form>

Could that be it? Where would I find the documentation/specifications that would demonstrate this?

+1  A: 

Show us the code for the input button (and general form). I think I've had this problem before, and the button wasn't of type 'submit' (or some other very very stupid mistake like that).

Noon Silk
Added full form code.
Dan Hulton
Damn. I wish I offer some help.
Noon Silk
A: 

Does the behavior change if you post to a page rather than the root of the site?

great_llama
Sadly, no. Originally, this page was mistakenly sending results to /login/index - which is the right controller path, but / routes to it by default anyway. I fixed it manually to target the root of the site and still no dice.It works in Firefox and Blackberry, so I'm guessing it's something to do with stricter parsers or something in Openwave and Nokia's offerings?
Dan Hulton
+3  A: 

The older Nokia Symbian 9 'servies' browser has a major (IMO) bug that causes POST variables associated with most HTML form elements to not be sent to the server. Users see radio buttons and check boxes as checked but when they submit the form the browser simply fails to send the POST data. I have observed the same issue you are reporting in N70, N71 and some other older Symbian 9 handsets in general circulation.

Older Nokia Symbian 9 handsets have two browsers: 'services' and 'web'. The main difference is the 'services' browser is for WAP browsing as the Webkit based browser does not include any support for WML which was the dominant mobile markup language at the time. The 'services' browser was set as the default browser in many of the handsets -- not sure when it changed, but sometime around the release of the N95. There are no issues when users use the Webkit based 'Mini Map' browser, but the 'services' browser looses the POST data.

If users access your page via a link in an SMS or MMS message they will be using the handsets default browser. I am not aware of any way to fix the bug and there is very little info on Forum Nokia or other sites. In my production sites I have tried to say away from POST forms where possible.

beggs