Delivering text/html to a wap browser will definitely make it choke a bit :-)

If you are using the same access mechanism for both web & wap access then you
have to sniff the client details to work out what to send back. Now you *could*
look at the USER_AGENT string of the request and work off of that, but frankly
that can get to be a real chore given the increasing diversity of wap browsers.
(Yeah, you could match 'Nokia', 'UP' or 'Ericsson' to get most of them)
Alternatively, best to look at the Accept content type field in the request, and
match on text/vnd.wap.wml for the WAP users. For them, you'll then need to set
the header type of any response to be that mime type. I'd have thought
$r->content_type() should work, surely. You aren't using header_out() somewhere
instead are you (IIRC the Eagle book says used content_type over this)

ps: I find the Phone.com UP SDK more informative when dealing with errors in
development. Of course, all the real phones deviate from the emulators anyway,
but thats another story.

pps: out of curiosity, are you relying on the wap gateway to store the cookie on
behalf of the wap browser or what ? I was under the impression that not all wap
browsers could deal with cookies


Tim Fulcher



Michael Smith wrote:

> Dear All,
>
> I'm trying to use AuthCookie to return a wml page for those lucky people on
> wap browsers.  I've got it all working nicely for normal web browsers, but
> am getting errors on wap (and the Nokia Wap Toolkit doesn't tell me very
> much about why it's an error).  One thing that looks a bit suspicious is the
> Content-type line which comes our as text/html - in fact to be precise it
> comes out as:
>
> Content-Type: text/html; charset=iso-8859-1
>
> I've tried to override this with things like $r->content_type but to no
> avail.  It seems that there's a line in http_protocol.c (line 2667) which is
> setting this (this response is harcoded there).
>
> Surely I ought to be able to override this ... in which case the obvious
> question is, how?
>
> Cheers
>
> Mike
>
> http://www.iii.co.uk
> Interactive Investor International is a leading UK Internet personal
> finance service that provides individuals with the capability to identify,
> compare, monitor and buy online a number of financial products and services.
>
> Interactive Investor Trading Limited, a subsidiary of Interactive Investor
> International plc, is regulated by the SFA.

Reply via email to