|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
why my php script can't loaded in my WAP browser
i have installed php and apache server with the configuration of Mime.type at httpd.conf like this:
AddType application/x-httpd-php-source .phps AddType text/vnd.wap.wml .wml AddType image/vnd.wap.wbmp .wbmp AddType text/vnd.wap.wmlscript .wmls AddType application/x-httpd-php .wml Addtype application/vnd.wap.wmlc .wmlc AddType application/vnd.wap.wmlscriptc .wmlsc then i try the Wml script with php like this: <?php header("Content-type: text/vnd.wap.wml"); echo("<?xml version=\"1.0\"?>\n"); echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n\n"); ?> <wml> <card id="activation" title="Activation"> <p> <?php $the_date = date("M d Y"); print $the_date; print "<br/>Welcome to a PHP-enabled site!"; ?> </p> </card> </wml> it is worked well, but when i have this script: <?php header("Content-type: text/vnd.wap.wml"); echo("<?xml version=\"1.0\"?>\n"); echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n\n"); ?> <wml> <card title="Volumetric Weight" id="volume"> <p align="left"> long (cm) : <br/> <input format="*N" maxlength="10" name="long"/><br/> width (cm) : <br/> <input format="*N" maxlength="10" name="width"/><br/> high (cm) : <br/> <input format="*N" maxlength="10" name="high"/><br/> <do type="accept" label="count"> <go href="test1.php"> <postfield name="long" value="$(long)"/> <postfield name="width" value="$(width)"/> <postfield name="high" value="$(high)"/> </go> </do> </p> </card> </wml> then i save with test.php after that i create a new script for counting volume with php like this: <?php header("Content-type: text/vnd.wap.wml"); echo("<?xml version=\"1.0\"?>\n"); echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n\n"); ?> <wml> <card title="Vol. Weight Result" id="hasil"> <p align="left"> Dimensi :<br/> $long x $width x $high <br/> <?php $vol = $long * $width * $high; $weight = $vol / 1000; echo ("weight = $weight kg<br/>"); ?> </p> </card> </wml> then i save it with name test1.php then the i try it in my WAP browser first test.php it worked well second when i click count test1.php the result is 0 Kg why that script cannot count what i input in the first test.php |
|
#2
|
||||
|
||||
|
Give a method to your form or $_GET is the default, which is OK of course, that is your choice.
When I am writing WAP, I don't use any wap variables at all. I use PHP's, I find it less confusing - though I havent done anything really complex. So, if you are using $_GET method, then on your final page: PHP Code:
You can always check what is coming through the form by using: 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. __________________ |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > why my php script can't loaded in my WAP browser |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|