Home arrow PHP arrow Page 4 - WAP-Enabling a Website with PHP3

Conclusions - PHP

Ever wonder what it took to get a site to work on those new "web-enabled" cell phones? This short tutorial will do just that by giving you the basics of making your site WAP-enabled using PHP.Reprinted from http://www.gbdirect.co.uk/ with permission.

TABLE OF CONTENTS:
  1. WAP-Enabling a Website with PHP3
  2. How it Works
  3. Switching to WML
  4. Conclusions
By: Mike Banahan
Rating: starstarstarstarstar / 23
June 12, 2000

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
It's dead easy if you follow the path of separating the data management from the presentation. Our approach works fine for us and we can easily add features to the WAP part of the site to bring it up to a similar spec to the main HTML site. Whether we would want to is another matter. WML is pretty ropey and it's my own opinion that people used to HTML browsers will be extremely frustrated if they get suckered by the hype about surfing the net from your mobile phone. Screens the size of typical mobile phones are well-nigh unusable and devices with more real estate will have enough power to run HTML browsers. The data compression of the WAP protocol is another thing - couple that with HTML and you will have something much more interesting.

The drawbacks that I've seen from using php3 like this are minor. The htmlspecialchars() function in php3 doesn't deal correctly with the WML entities that need escaping, but I intend to write my own version and put it in the stdwaphdr.tpl include file. If php3 finds a syntax error it tries to be nice and tell the user via the browser - but it outputs HTML not WML while it does it. Hardly a show-stopper if you have got your php3 code right in the first place, but should it happen then the user's browser will choke. I'm told that WAP phones are even less reliable than Windows at the moment: an article in this month's Personal Computer World describes having to remove the battery from the phone when it gets wedged.

It works, it's simple and I'm sure we will be doing more with this.

Mike Banahan, GBdirect, 22nd April 2000

Update 22nd May 2000
If you want a copy of the templates used on the wap site, I have prepared a gzipped tarfile of them which you can use for information. Note that the server will serve them up as text/plain - just click on `save as' and drop the file into an appropriate directory before unpacking it. The files will unpack into the current directory, so make sure you put the archive somewhere sensible first. If you spot any errors, I'd love to know.

This article copyright GBdirect Ltd 2000. All rights reserved. Reprinted from http://www.gbdirect.co.uk/ with permission.



 
 
>>> More PHP Articles          >>> More By Mike Banahan
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap

Dev Shed Tutorial Topics: