WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old July 8th, 2005, 10:02 AM
silverman silverman is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 1 silverman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 44 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old July 9th, 2005, 12:12 AM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,670 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 4 Days 6 h 10 m 50 sec
Reputation Power: 1618
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
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:
 $vol $_GET['long'] * $_GET['width'] * $_GET['high']; 


You can always check what is coming through the form by using:
PHP Code:
print '<pre>';
print_r($_REQUEST);
print 
'</pre>'
__________________
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.

__________________

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > why my php script can't loaded in my WAP browser


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway