WML and PHP AND mysql

From: Date: Thu, 08 Feb 2001 11:06:55 +0000
Subject: WML and PHP AND mysql
Groups: php.db 
Request: Send a blank email to php-db+get-6469@lists.php.net to get a copy of this message
Author: Kato Strandjord (katos.tihlde.org) Date: 06/02/2001 15:41 I use apache server on win2000, php4, mysql and wml which I test local on my harddrive. The code under is working fine when I test it on emulators like UP SDK from phone.com. or other, but i have fooled it to use static variables which is not the solution i want. My problem is. How can I use my variable: print "<select name=\"fagkode\">"; in this code under so that I can use its value in my php function: $tabfag=finnMeldinger($fagnr); I can see the WML variable if i print it out in WML, but i can not print it out as a variable in PHP. I have fooled the php function and put a static variable in it, instead of the dynamic WML variable, which is generated from a select list. I have tried for a week but al kinds of tricks did not work. At one time i got the value from WML to PHP, but it came out like this "=so480". The sign = was impossible to remove, so i could not use it. The correct value is "so480" with out the "=" <?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 2"> <p> <?php print "<select name=\"fagkode\">";//HELP1 require ("funksjoner.php"); $tabfag=finnfag(); if (mysql_num_rows($tabfag) > 0) { while ($row = mysql_fetch_array($tabfag)) { print "<option value=\"$row[fagkode]\">$row[fagbeskrivelse]</option>"; }//while }//if $temp=$fagkode; ?> </select>Done. <anchor title="go"> <?php print "go $(fagkode)";//testing if i can see the WML variable from HELP1, and i can, but i can not use it in my PHP function ?> <go href="#dato"/> </anchor> </p> </card> <card id="dato" title="dato"> <p><select name="dato">//HELP2 <?php $fagnr="so480";//fooling the function with a static code, but this should be the HELP1 $tabfag=finnMeldinger($fagnr);//this is the ma in problem, Impossible to solve!!!! if (mysql_num_rows($tabfag) > 0) { while ($row = mysql_fetch_array($tabfag)) { print "<option value=\"$row[dato]\">$row[dato]</option>"; }//while }//if ?> </select>Done. <anchor title="go"> go $(fagkode) $(dato)// just another test, and is working fine so i can see both WML variables from other cards <go href="#meld"/> </anchor> </p> </card> <card id="meld" title="meld"> <p><?php $datonr="051201";//fooling the function, but this should be the WML varibeles value in HELP" $meldingen=finnMelding($fagnr,$datonr);// using the static value, should be HELP1 and HELP2 dynamic value instead!! print "$meldingen"; ?></p> </card> </wml>

« previous php.db (#6469) next »