wml and php

From: Date: Sat, 27 Sep 2003 19:33:49 +0000
Subject: wml and php
Groups: php.general 
Request: Send a blank email to php-general+get-164106@lists.php.net to get a copy of this message
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&#xE4;mta"> <p> <u><b>Ladda ner mobill&#xE5;tar</b></u> </p> <p> L&#xE5;tnummer:<input type="text" name="nummer"/> </p> <do type="accept" label="H&#xE5;mta"> <go href="#card2"/> </do> </card> <card id="card2" title="H&#xE4;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&#xE4;mta</a> <?php } else { echo "Det finns ingen l&#xE5;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

« previous php.general (#164106) next »