...

View Full Version : Createing WAP/WML Pages with PHP



Switch17
09-10-2003, 10:43 PM
I'm attempting to learn how to create some WML pages to view on a Smartphone, and came across this website Here (http://www.edevcafe.com/viewdoc.php?eid=44) in attempting to get started.

Well, the site shows to create this file as sample/test page. However, when I pull up my test page on my Smartphone, I get an error on line 4. I'm still fairly new at php, so if anyone can help, it would be great.


<?php
// send wml headers
header("Content-type: text/vnd.wap.wml");
echo "<xml version="1.0"?>";
echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""
. " "http://www.wapforum.org/DTD/wml_1.1.xml">";
?>

<wml>
<card id="card1" title="Example 1">
<p>
<?php
// format and output date
$the_date = date("M d Y");
print $the_date;
print "<br/>Welcome to a PHP WAP-enabled site!";
?>
</p>
</card>
</wml>

Nightfire
09-10-2003, 10:47 PM
You need to escape the quotes in the strings

echo "<xml version=\"1.0\"?>";

or change the quotes to single quotes (if they're called that)

echo '<xml version="1.0"?>';

Also need to do the same on the lines below too

Íkii
09-10-2003, 11:32 PM
if you have short tags on you'll also need to seperate the ?> within the echo

echo '<'.'?xml version="1.0"?'.'>';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum