Hi, does anyone know how to transfer a variable in wml to php?, i got this
script that i made and i cant transfer the wml info to php.
<?php
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\" ?>";
?>
<!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.1//EN"
"http://www.phone.com/dtd/wml11.dtd" >
<wml>
<card id="card1" title="Hämta">
<p>
<u><b>Ladda ner mobillåtar</b></u>
</p>
<p>
Låtnummer:<input type="text" name="nummer"/>
</p>
<do type="accept" label="Håmta">
<go href="#card2"/>
</do>
</card>
<card id="card2" title="Hämta">
<p>
<?php
$server = "localhost";
$user = "abc123";
$pass = "abc123";
$db = "mob";
mysql_connect($server, $user, $pass);
mysql_select_db($db);
$latnum2 = "$(nummer)";
$sql = "SELECT filnamn FROM mobilesongs WHERE nummer = '$latnum2'";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if (!$num == "0") {
$row = mysql_fetch_row($result);
?>
<a href="<?php echo $row[0]; ?>">Hämta</a>
<?php
} else {
echo "Det finns ingen låt med det nummret.";
}
mysql_free_result($result);
?>
</p>
<do type="accept" label="Prev">
<prev/>
</do>
</card>
</wml>
the problem is: $latnum2 = "$(nummer)";
if i do a echo $latnum2 it prints out the desired number that was typed in,
but
if i try to use it in a sql statement i get that the post dosent excist.
Then i tried a echo substr($latnum2, 1, 5); witch printed out (numm
So my question is how do i get the actual number to php?, do i have to use 2
php pages? or is there a way to retrive the actual value from wml?
regards
patrick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php