Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: php wap help


Message #1 by "Richard D. Williams" <richard@a...> on Sat, 09 Mar 2002 11:51:39 -0600
Anyone out there using WinWAP and php?

I have been slamming my head against a wall. I have this script that
just doesn't act right.  I have placed both wml/php pages at the bottom
of this message.  I have written these in html/php and they work fine.

The wml version will not read the variables passed to the query on the
second card.
$queryA = "SELECT * FROM workinprog where ez_num = '$ez_num'";
If I hard code the ez_num variable, i.e.. to 605944, it works!  But when
I input the same value to the input statement it does  not work inside
this query.  Although, the $_ez_num does show up in this statement.
echo ("</SELECT><br\><p>You selected: $(ez_num)</p>");

I have tried every combination of symbols around the $ez_num inside this
query and nothing is working.  I am also having a problem with the
<select> statement.  Instead of a nice single select box I get this;

ame="choice1" value="1" title="Codename"\>
 00 . Served
 01 . We believe the address to be good, but unable to contact.
 02 . Address is vacant.
 03 . Moved. Spoke with neighbor, address unknown.
 04 . Closed business.
 05 . Relatives at address state subjects current address unknown.
 06 . Locked, gated property, with no access.
 07 . Service on individual not allowed per company policy.
 08 . No answer at residence on multiple attempts.
 09 . Residents at above address appear to be avoiding service.
 10 . New address from OSI.
 11 . Party is out of town, but should return.
 12 . Service cancelled by client.
 13 . No such address.
 14 . Unknown at above address.

You selected: 605944

I am in desparate need of help to get by this little problem.  I think
once this is done, I will be able to complete my project.

Any and all help will be greatly appreciated.

Richard D. Williams

Code for server.php3:
<?php
Header("Content-type: text/vnd.wap.wml");
printf("<?xml version=\"1.0\"?>\n");
printf("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" ".
"\"http://www.wapforum.org/DTD/wml_1.1.xml\" >\n");
$userName="";
$password="";
$hostname="localhost";
$database="ezm";
$db = mysql_pconnect($hostname,$userName,$password);
mysql_select_db($database,$db);
?>
<wml>
<card id="card1" title="EZNUM">
<do type="accept" label="Answer">
<go method="post" href="server1.php3#card2"/>
<postfield name="ez_num" value="$(ez_num)" />
</do>
<p>
EZ#:  <input name="ez_num" size="11" format="*N"/><br/>
</p>
</go>
</card>
</wml>

Code for server1.php3:
<?php
Header("Content-type: text/vnd.wap.wml");
printf("<?xml version=\"1.0\"?>\n");
printf("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" ".
"\"http://www.wapforum.org/DTD/wml_1.1.xml\" >\n");

$userName="";
$password="";
$hostname="localhost";
$database="ezm";
$db = mysql_pconnect($hostname,$userName,$password);
mysql_select_db($database,$db);

printf ("<wml>
<card id='card2' title='Answer'>");

$queryA = "SELECT * FROM workinprog where ez_num = '$ez_num'";
$linkA = mysql_query($queryA);
if ($myrow = mysql_fetch_row($linkA)) {
echo ("<p>$myrow[0], $myrow[1]</p>\n");
}
?>
<select name="choice1" value="1" title="Codename"\><br\>
<?php
$queryAA = "SELECT * FROM actcodes";
$linkAA = mysql_query($queryAA);
while ($myrow1 = mysql_fetch_row($linkAA)) {
$one = $myrow1[0];
$two = $myrow1[1];
printf ("<OPTION VALUE=\"1\">$one . $two</option><br\>");
}
echo ("</SELECT><br\><p>You selected: $(ez_num)</p>");
?>
</card>
</wml>






  Return to Index