PHP General

--------------------------------------------------------------------------

      Subject: WML & PHP4 using same variable
      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 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>





begin 666 left1.gif
M1TE&.#EA% `4`+,````_7"YB>3IK@5^'F7:8IYJSOIRTP./J[>WQ\_[^_O__
M_P```````````````````"P`````% `4```$+%!)><P((.L-9BH")VH20HQH
=EYSIJ!0M>H2Q:-3C@(O8[O_ H'!(+!J/R$T$`#L`
`
end

begin 666 right1.gif
M1TE&.#EA% `4`+,````_7"YB>3IK@5^'F7:8IYJSOIRTP./J[>WQ\_[^_O__
M_P```````````````````"P`````% `4```$+!#(24$8YJB]JY]"D7!?"1!(
=9W[$N):%\G[",7_&[0UZ%?3 H'!(+!J/R&0$`#L`
`
end


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to