Thread: WML via PHP?

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Vienna, Austria
    Posts
    3
    Rep Power
    0
    I'm just a beginner with Apache, PHP and MySql. My goal is to set up a WML-server, what is no problem when using static pages. Where I could not get until now is to use PHP to create dynamic WML pages. Is that possible? An how?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    Hi,

    PHP and Apache don't care at all what type of client-side code you use. So for HTML you might code in PHP:

    echo ("<html><body>My page</body></html>");

    You could just as easily have PHP generate WML code:

    echo ("<wml><card id="begin" title="Home"><p>My card</p></card></wml>");

    I was just surprised to read that you're using an HTTP server like Apache. I thought that WML applications use a WAP server like the Nokia WAP Server ( http://www.nokia.com/wap/products.html ). Am I wrong? Do people also serve WML via HTTP?

    -- Christopher

    [This message has been edited by scollo (edited March 07, 2000).]
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Location
    Netherlands
    Posts
    77
    Rep Power
    15
    As far as I know about WAP, you host the WML pages on a HTTP server, but you need a Gateway to binary encode the pages and send them to the mobile phone.
    The gateway is the tricky commercial part in it!

    Peter
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Vienna, Austria
    Posts
    3
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by scollo:
    Hi,

    PHP and Apache don't care at all what type of client-side code you use. So for HTML you might code in PHP:

    echo ("<html><body>My page</body></html>");

    You could just as easily have PHP generate WML code:

    echo ("<wml><card id="begin" title="Home"><p>My card</p></card></wml>");

    I was just surprised to read that you're using an HTTP server like Apache. I thought that WML applications use a WAP server like the Nokia WAP Server ( http://www.nokia.com/wap/products.html ). Am I wrong? Do people also serve WML via HTTP?

    -- Christopher

    [This message has been edited by scollo (edited March 07, 2000).]
    [/quote]

    In the meantime I learned a lot about Apache and PHP. And yes, it's absolutely possible to use Apache as WAP server.

    Bernhard

  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Kongsberg
    Posts
    1
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by BMager:
    I'm just a beginner with Apache, PHP and MySql. My goal is to set up a WML-server, what is no problem when using static pages. Where I could not get until now is to use PHP to create dynamic WML pages. Is that possible? An how?[/quote]

    Hi.

    you should send a header field with the right mimetype:

    <?php
    header("Content-Type: text/x-wap.wmlnn");
    ?>

    if you have enabled the <? ?> tags in php3, you'll have to write the leading <?xml> tag with echo ""; or something.

    regards. larsw.



    ------------------
    Lars Wilhelmsen
    Buskerud College,
    Department of Computer Science,
    Faculty of Engineering,
    Kongsberg, Norway
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Hamburg, Germany
    Posts
    1
    Rep Power
    0
    Right, Apache+php is the best way to use WML (because of header tag) if the provider's server is still not ready for .wml-extention.

    <?php 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">";
    $DECK = "<wml> <card> <p>Hello, World</p></card></wml>";
    echo $DECK;
    ?>

    Best regards


    Konstantin
    http://www.waply.com
    WAP Portal + Search Engine

    [This message has been edited by Kostik (edited March 08, 2000).]
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Milton Keynes, Bucks, UK
    Posts
    1
    Rep Power
    0
    A WAP Server kit costs 180,000 (U.K.).

    Don't quote me on that as I will check my source a.s.a.p.

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 10:45 PM
  2. PHP validation in WML
    By Phily in forum PHP Development
    Replies: 2
    Last Post: January 28th, 2004, 08:47 AM
  3. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 01:14 PM
  4. Passing string from PHP to Javascript
    By ka8oad in forum JavaScript Development
    Replies: 4
    Last Post: January 17th, 2004, 03:12 PM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 01:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo