|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
HELP!! If statement problem..
hi everyone, i'm a very newbie in wap programming. I'm creating my first wap system and there is a problem which i could not solve even i have tried a lot of samples.
The problem is in the if statement which comparing the variable with database value for login. Below is the code: Code:
<?php
session_start();
session_register('username');
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="Ordering">
<p>
<?
print '$category--<br/>';
if ($category == 'chinese')
print "Yes!!";
else
print "NO!";
?>
</p>
</card>
</wml>
The value of $category is empty when it is in the IF statement. But when I print '$category'; the value is there. HELP... and Thanx.. |
|
#2
|
||||
|
||||
|
Where does $category come from?
Your php should be PHP Code:
__________________
Cheers, Jamie # skiFFie | Home of the 'accessibility module' for Drupal # Jamie Burns [me] Accessibility Module [drupal] # guidelines | search | wap resources | not getting help | fold to cure # Any form of employment is strictly prohibited ...... __________________ 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
|
|||
|
|||
|
Thanx for your respond, i have tried your suggestion but it still doesn't work
. The category is come from:[CODE]<?php session_start(); session_register('username'); 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 ="card2" title="Ordering"> <p> Select your variety of foods: <select name="category"> <option value="chinese">Chinese Foods</option> <option value="indian">Indian Foods</option> <option value="american">American Foods</option> </select> <do type="accept" label="Submit"> <go href="order.php" method="post"> </go> </do> </p> </card> </wml> |
|
#4
|
||||
|
||||
|
Looks like you are not carrying the form variables through to the next page:
PHP Code:
|
|
#5
|
|||
|
|||
|
ooh... Thanks a lot, it is working now. But now i've encountered a new problem.
Code:
//Generate random number
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double)microtime()*1000000);
$i = 0;
while ($i <= 7)
{
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
print " $pass = $pass . $tmp";
$i++;
}
print '$pass--<br/>';
The variable in $pass is empty, also when i print the $pass = $pass.$temp. Thanks for your help. I'll really appreciate it. |
|
#6
|
||||
|
||||
|
So where is $pass coming from?
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > HELP!! If statement problem.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|