Hi everybody,
I need helping hand for this program.Sorry if my english isn't good.I'm thai.And I tried to ask many grogrammer in thailand,but no one can help me.
I use Nokia Toolkit 3.0 + PHP4 + Apache 1.3.22.
My program now has 2 pages "SE.php and Search.php"
SE.php is input by user then send ($keyword) to Search.php.
SE.php
<?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 title="Bus Routing" id="input">
<p>
<do type="text" label="OK">
<go href="http://127.0.0.1/Search.php">
<postfield name="keyword" value="$(S)"/>
</go>
</do>
Enter Keyword : <input name="S" title="Enter Keyword"/>
</p>
</card>
</wml>
Search.php
<?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="Search Result">
<p>
<?php
$hostname="127.0.0.1";
$user="project";
$password="project";
mysql_connect($hostname, $user, $password) or die("Can't connect DB");
mysql_select_db("project") or die("Can't choose DB");
echo('$keyword'); --can't get the value but
echo('$S'); --can get the value
/$sql = "select Name from place where Name like '%" .'$keyword'. "%'";
echo $sql;
$query = mysql_query($sql);
$num_rows = mysql_num_rows($query);
$i=0;
while($i < $num_rows) {
$result = mysql_fetch_array($query);
$Name = $result["Name"];
echo("$Name");
echo("<br/>");
$i++;
}
mysql_close();/
?>
</p>
</card>
</wml>
My problem is can't echo ($keyword) it seems to doesn't send the value, and I found in URL like "http://127.0.0.1/Search.php?keyword=CE" It's mean that it sent the value of $keyword,isn't it?
But it can get the $S value when I "echo ($S)".So what's mean?
I've tried to remove & install Apache&PHP again, but it still got the same problem.
I always visit this web.It so usefull.Hope someone can be my helping hand....By the way my E-mail address is project4f@hotmail.com
Best Regards,
Roongjarasnont, Viriya