Re: WML/WAP and PHP

From: Date: Tue, 16 Jan 2001 17:08:39 +0000
Subject: Re: WML/WAP and PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-34856@lists.php.net to get a copy of this message
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). 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. [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).

« previous php.general (#34856) next »