PHP WML Mysql

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dom

    PHP WML Mysql

    I am trying to convert this file so that I can use it with a WAP
    Emulator to WML. Can anyone help me to convert it. I have tried what I
    thought was correct but keep getting error messages.

    <html>



    <body>



    <?php



    $db = mysql_connect(" localhost", "root");



    mysql_select_db ("mydb",$db) ;



    $result = mysql_query("SE LECT * FROM employees",$db) ;



    printf("First Name: %s<br>\n", mysql_result($r esult,0,"first" ));



    printf("Last Name: %s<br>\n", mysql_result($r esult,0,"last") );



    printf("Address : %s<br>\n", mysql_result($r esult,0,"addres s"));



    printf("Positio n: %s<br>\n", mysql_result($r esult,0,"positi on"));



    ?>



    </body>



    </html>



    Also can anyone recommend a good WAP Emulator to use with Mysql and
    PHP.
  • Janwillem Borleffs

    #2
    Re: PHP WML Mysql

    Dom wrote:[color=blue]
    > I am trying to convert this file so that I can use it with a WAP
    > Emulator to WML. Can anyone help me to convert it. I have tried what I
    > thought was correct but keep getting error messages.
    >[/color]

    WML is NOT HTML. Per example, the following:

    <html>
    <body>
    <br>
    </body>
    </html>

    will be the following in WML:

    <wml>
    <card id="myCard" title="Some title">
    <br />
    </card>
    </wml>

    Read up on the WAP protocol before you continue. A good place to start is:




    JW



    Comment

    • Dom

      #3
      Re: PHP WML Mysql

      I understand the principles of WML. I was just wondering whether it is
      possible to easily convert this HTML page into a page that can be used
      for WAP. I have tried to make a few modifications to change it into a
      WML page, but I kept getting errors about the PHP.

      Any help would be greatly appreciated.






      "Janwillem Borleffs" <jw@jwscripts.c om> wrote in message news:<413b121e$ 0$58989$b83b6cc 0@news.euronet. nl>...[color=blue]
      > Dom wrote:[color=green]
      > > I am trying to convert this file so that I can use it with a WAP
      > > Emulator to WML. Can anyone help me to convert it. I have tried what I
      > > thought was correct but keep getting error messages.
      > >[/color]
      >
      > WML is NOT HTML. Per example, the following:
      >
      > <html>
      > <body>
      > <br>
      > </body>
      > </html>
      >
      > will be the following in WML:
      >
      > <wml>
      > <card id="myCard" title="Some title">
      > <br />
      > </card>
      > </wml>
      >
      > Read up on the WAP protocol before you continue. A good place to start is:
      >
      > http://www.openmobilealliance.org/te.../wapindex.html
      >
      >
      > JW[/color]

      Comment

      • Janwillem Borleffs

        #4
        Re: PHP WML Mysql

        Dom wrote:[color=blue]
        > I understand the principles of WML. I was just wondering whether it is
        > possible to easily convert this HTML page into a page that can be used
        > for WAP. I have tried to make a few modifications to change it into a
        > WML page, but I kept getting errors about the PHP.
        >
        > Any help would be greatly appreciated.
        >[/color]

        <?
        header("Content-Type: text/vnd.wap.wml");
        // In case open_short_tag support is enabled
        print '<?xml version="1.0" encoding="iso-8859-1"?>'."\n";
        ?>
        <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
        "http://www.wapforum.or g/DTD/wml_1.1.xml">
        <wml>
        <card id="myCard" title="Some title">
        <?php
        $db = mysql_connect(" localhost", "root");
        mysql_select_db ("mydb",$db) ;
        $result = mysql_query("SE LECT * FROM employees",$db) ;

        printf("First Name: %s<br />\n", mysql_result($r esult,0,"first" ));
        printf("Last Name: %s<br />\n", mysql_result($r esult,0,"last") );
        printf("Address : %s<br />\n", mysql_result($r esult,0,"addres s"));
        printf("Positio n: %s<br />\n", mysql_result($r esult,0,"positi on"));

        ?>
        </card>
        </wml>


        JW



        Comment

        Working...