Re: PHP function using a WML variable from a select list as to access the right data in a MYSQL database

From: Date: Fri, 09 Feb 2001 02:49:53 +0000
Subject: Re: PHP function using a WML variable from a select list as to access the right data in a MYSQL database
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38887@lists.php.net to get a copy of this message
I'm not sure I'm following the purpose, but you need to access a whole 'nother page (or, at least, a whole 'nother HTTP connection) to select HELP1 or HELP2 from your phone. It seems like you're trying to get your WAP to execute PHP somehow, and that won't happen. [This week, anyway :-)] Disclaimer: What I know about WAP could fit inside a WAP. :-) -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Kato Strandjord" <katos@stud.idb.hist.no> Newsgroups: php.general Sent: Thursday, February 08, 2001 5:04 AM Subject: [PHP] PHP function using a WML variable from a select list as to access the right data in a MYSQL database > 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 main 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> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#38887) next »