Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-10-2003, 10:43 PM   PM User | #1
Switch17
Regular Coder

 
Join Date: Jun 2002
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Switch17 is an unknown quantity at this point
Createing WAP/WML Pages with PHP

I'm attempting to learn how to create some WML pages to view on a Smartphone, and came across this website Here 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.

Code:
<?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>
Switch17 is offline   Reply With Quote
Old 09-10-2003, 10:47 PM   PM User | #2
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
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
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 09-10-2003, 11:32 PM   PM User | #3
Ökii
Regular Coder

 
Join Date: Jun 2002
Location: UK
Posts: 577
Thanks: 0
Thanked 0 Times in 0 Posts
Ökii is an unknown quantity at this point
if you have short tags on you'll also need to seperate the ?> within the echo

echo '<'.'?xml version="1.0"?'.'>';
__________________
Ökii - formerly pootergeist
teckis - take your time and it'll save you time.
Ökii is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:15 AM.


Advertisement
Log in to turn off these ads.