|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I encountered this problem with variable passing. When I take in a variable from input card and compare that variable with database variable it does not match however when echoed it shows that both are the same. the if condition if($n==$an) never becomes true! How to over come this problem it'll be greate to get your ideas. I am very new to WML. Pls help thank you guys Code:
<?php
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"(URL address blocked: See forum rules)\">";
?>
<wml>
<card id="card1" title="Input">
<do type="accept" label="Login">
<go href="#card2"/>
</do>
<p>
Name:<input name="name" size="10"/><br/>
Pass:<input name="pass" size="10"/><br/>
</p>
</card>
<card id="card2" title="Welcome">
<p>
<?php
print "Welcome: $(name)<br/>";
print "Your pass is: $(pass)<br/>";
$an = "$(name)";
$ab = "$(pass)";
echo "$an";
include("connect.php");
$query = "select username from admin";
$result = @mysql_query($query);
while ($row = mysql_fetch_array($result)) :
$n = $row['username'];
$p = $row['username'];
echo "$n";
if($n==$an){
print "login successful<br/>";
}
endwhile;
print "Welcome: $an $n<br/>";
$the_date = date("M d Y");
print $the_date;
?>
</p>
</card>
</wml>
|
|
#2
|
||||
|
||||
|
Hi, I think the issue is that you are mixing PHP and WML variables.
When I did WML pages using PHP, I used primarily PHP variables as they seemed to be slightly more reliable. Try print_r($_REQUEST) on your results page and see what you get.
__________________
Cheers, Jamie # mdb4u | mobile movie database | Currently being revamped # skiFFie | Jamie Burns [me] # guidelines | search | wap resources | not getting help | fold to cure __________________ Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. ![]() __________________ |
|
#3
|
|||
|
|||
|
Hi,
Thanks for your reply. Yes its due to variable difference I was able to follow some instructions from a different threat and was able to get arround the problem. When I pass the variable to a different page and use GET the variable is usable. Code:
<go href="auth.php?n=$(name)&p=$(pass)"/> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Mobile Programming > WML and PHP with MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|