×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    1

    PHP to WML problem

    Hello,

    I'm having problems when trying to print something from a PHP program in WML form. There's an example below.

    Firstly, I'm using <do> & <go> -tags in my little WML program to get to PHP program. Then the PHP program (the code below) should print something in the next card. I'm using www.wapsilon.com emulator for testing, and when the PHP program should work, the emulator is saying "Wrong mime-type, I got text/html, but I want text/vnd.wap.wml".

    The most interesting thing is that when you use some basic internet browser with the code, go to Source -page, copy the resulting printed wml code, and create a new WML file with the code. Then it works fine also through the Wapsilon emulator.

    Code:
    <?php
    
    $alku1 = '<?php';
    $alku2 = 'header("Content-type: text/vnd.wap.wml");';
    $alku3 = '?>';
    
    $otsikko = '<wml> <card id="card1" title="Haku"> <p> <fieldset title="Toimittajat">';
    $otsikko2 = ' Toimittajat: </fieldset> </p> </card> </wml>';
    
    print "$alku1\n";
    print "$alku2\n";
    print "$alku3\n";
    
    print "$otsikko";
    print "$otsikko2";
    
    ?>

  2. #2
    Registered User
    Join Date
    Jun 2004
    Location
    HEL
    Posts
    36

    Re: PHP to WML problem

    You need to use eval or write your code differently.
    Of course your code won't work otherwise.

    Perhaps an easier way is to do something like this:
    Code:
    <?php
    header("Content-type: text/vnd.wap.wml");
    
    $alku = '<?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">';
    
    $otsikko = '<wml> <card id="card1" title="Haku"> <p> <fieldset title="Toimittajat">';
    $otsikko2 = ' Toimittajat: </fieldset> </p> </card> </wml>';
    
    print $alku;
    print $otsikko;
    print $otsikko2;
    See eval for alternative...
    Cheers,

    Jamie

    # Any form of employment is strictly prohibited ......

Similar Threads

  1. PHP session problem help! Plz~~
    By ai_pinkflower in forum Browsing and Mark-ups
    Replies: 5
    Last Post: 2006-01-24, 17:17
  2. Internet Mobile Toolkit 4.1 - problem with wml files editing
    By eugenyvs in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2005-02-28, 21:09
  3. Time problem with wml and php
    By Mihaiu in forum Mobile Web Site Development
    Replies: 0
    Last Post: 2003-05-20, 13:22
  4. WML and PHP
    By childsdesign in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2002-05-20, 17:31
  5. Writing WML with PHP
    By Nokia_Archive in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2002-05-14, 19:23

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •