PHP and WAP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nw
Forum Newbie
Posts: 1
Joined: Tue Jun 25, 2002 4:03 am

PHP and WAP

Post by nw »

:?: How to generate WAP-file with PHP help? And can i upload such file to web serwer as PHP-file and read it from mobile? I've uploaded one PHP-file to WEB-server, but i can't view it from mobile. Why? Thanks! 8O
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

You can leave it as a php file on the server, so it will create the page content dynamically when the page is requested.

All you need to do is specify the content-header,

Code: Select all

header ("Content-Type: text/vnd.wap.wml");
should do it. You should also need this specified in the servers MIME-type file.
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

Here is a sample wap page, just save it as a .php file. Your webserver must support WAP for this to work, your provider will be able to tell you if it does.

<?php
header("Content-Type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
?>
<wml>
<card id="main" title="My WAP">
<p align="center">
Welcome to<br/>
WAP<br/>
http://www.mysite.com
<br/>
<small></small>
</p>
</card>
</wml>
Post Reply