Re: WML/WAP and PHP

From: Date: Wed, 17 Jan 2001 09:33:36 +0000
Subject: Re: WML/WAP and PHP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-35002@lists.php.net to get a copy of this message
Chris Adams <chris@improbable.org> wrote in message news:slrn96900n.s3.chris@gigante.improbable.org... > On 16 Jan 2001 05:05:18 -0800, Rick Hodger <rick@domainsbuy.com> wrote: > >Here's a fun little thing I discovered, possibly a bug in PHP itself? > > > >To output a WAP page you must output a content-type header else the phone's > >browser won't recognise the page. Dead simple. Use: > > > >header("Content-type: text/vnd.wap.wml"); > > > >And all is well and good as long as you use echo/printf etc to output your > >page. The second you deviate out of PHP and back to HTML the content-type > >gets overwritten with a text/html, and so the page doesn't work. ASP used > >to be able to cope with this, is it a bug or something I'm doing wrong? > > Hmmm - you might need to start checking details of your configuration. I've had > no problems doing a lot of WML work in PHP and it's always correctly returned > the content-type I've set using header on 4.0.3pl1 (OpenBSD) and 4.0.3 / 4.0.4 > (Win32). I've come to the conclusion it must be something in the configuration. It works from the commandline on a couple of Linux machines, but not on my Windows laptop. > Do you have anything like output buffering turned on? I doubt that's causing > the problem as I use output buffering semi-frequently[0] but it can't hurt to > check. That was one of the first things I tried, off by default...tried turning it on but no different. I'll just have to live with echo'ing the pages out until I can get it sorted. > [0] neat hack - use ob_content_length() to tell when you've output almost as > much data as the phone can handle (find this by doing a browser detect) so you > can stop looping over a recordset and emit the Next/Prev page headers instead). Ooh....hadn't actually thought of that one. I'll have to make a note. Cheers :) -- Rick Hodger

« previous php.general (#35002) next »