×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2003
    Location
    Zurich, Switzerland
    Posts
    1

    WML+PHP='No response, try again' why?

    Hello everybody

    I just startet developing WML sites, so I don't have much experience in that.
    I wrote a little php-script to read some information from a .txt file an display it on the mobile device.

    But there I have a problem: Everytime I open this page with a mobile phone it just displays 'No response, try again'. With the WinWap Simulator and gelon.net it works absolutely properly.

    My Code:
    <?php
    header("Content-Type: text/vnd.wap.wml");
    include ("admin/functions.php");
    include ("admin/time.php");
    $layout = LoadFile ("admin/empty.html");

    $entry_style = "%date% %location%";

    $fhndl = fopen("admin/events.dat", "r");
    $count = 0;

    while (!feof($fhndl))
    {
    $linet = fgets($fhndl, 4096) . "\n";
    if ($linet != "\n")
    {
    $entry[$count] = $linet;
    $zeugs = explode(chr(2), $linet);
    $entry_date[$count] = $zeugs[3] . chr(2) . $count;
    $count++;
    }
    }

    $content = "";

    if ($count > 0)
    {
    sort ($entry_date);
    reset ($entry_date);
    $old_con = "";

    //Alle Einträge ausgeben (Display all entries)
    $done = 0;
    if ($start < 0) $start = 0;
    for ($y = 0; $y < $count && $done < 10; $y++)
    {
    //Lesen welcher Eitrag ausgegeben werden soll
    //Read which entries should be displayed
    $which_txt = explode (chr(2), $entry_date[$y]);
    $x = $which_txt[1];

    $act_entry = explode(chr(2), $entry[$x]);

    //Eintrag zu alt? (Entry too old?)
    $the_date = $act_entry[3];
    $the_date = explode ("-", $the_date);
    $the_date = $the_date[2] . "." . $the_date[1] . "." . $the_date[0];

    $theentry = $entry_style;
    $theentry = str_replace("%name%", $act_entry[0], $theentry);
    $theentry = str_replace("%desc%", $act_entry[1], $theentry);
    $theentry = str_replace("%location%", $act_entry[2], $theentry);
    $theentry = str_replace("%date%", $the_date, $theentry);
    $theentry = str_replace("%timebegin%", $act_entry[4], $theentry);
    $theentry = str_replace("%timeend%", $act_entry[5], $theentry);
    if ($act_entry[3] < "$tim_year-$tim_month-$tim_day")
    { $old_con = $theentry . "<br/><br/>\n" . $old_con; continue; }

    if ($content == "")
    $content = $theentry;
    else
    $content .= "<br/><br/>\n" . $theentry;
    $done++;
    }
    }

    if ($content == "") $content = "Weitere Daten folgen.<br><br>";
    if ($old_con == "") $old_con = "Wir haben noch keine Auftritte gehabt.<br><br>";

    $layout = str_replace("%old%", $old_con, $layout);
    $layout = str_replace("%new%", $content . "<br/><br/>\n", $layout);
    echo $layout;

    ?>


    Is there something incorrect?
    the adress is wap.thomaskullband.ch -> Konzertdaten


    thanks for your help!
    Rabbi

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    334
    Hi!

    I downloaded the output file php is generating and find out following:

    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <wml>
    <card>
    n&auml;chste auftritte:<br><br>13.09.2003 dübendorf<br/><br/>
    04.10.2003 stadthof uster (mit gigi moto,vera kaa)<br/><br/>
    29.10.2003 stadthalle uster (accousticfinal)<br/><br/>

    </card>
    </wml>

    Some comments on that:

    1) <p>....</p> elements are missing inside the <card> element. The actual text should be generated inside the <p> elements.

    2) <br> element is not valid. You should use <br/> element to get the line break in your output.



    Kind regards,

    sami / Forum Nokia Developer Support

Posting Permissions

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