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:
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  
Old March 17th, 2006, 11:32 AM
meangene01 meangene01 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 2 meangene01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 34 sec
Reputation Power: 0
Dynamic PHP with WML

So I'm trying to build a dynamic site with WML/PHP and I having difficulty getting the PHP to show up in the WAP browser. I built a simple file and all I get on my phone (Treo 650) is a blank page.

Here's the code:

PHP Code:
<?xml version="1.0"?>
<?DOCTYPE wml 
PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"?>
<!-- -->
<?php 
// send wml headers
Header("Content-type: text/vnd.wap.wml");
Header("Cache-Control: no-cache, must-revalidate");
Header("Pragma: no-cache"); 
?>
<wml>
<card id="card1" title="hello">
  <p>
  <?php
    
echo 'Hello World!';
  
?> 
</p>
</card>
</wml>


I ran the code through w3schools validator and didn't receive any errors so my guess is that either the phone network (Sprint) WAP Gateway isn't working right OR the web server isn't recognizing the PHP--any ideas?

Gene

Last edited by jabba_29 : March 17th, 2006 at 08:55 PM.

Reply With Quote
  #2  
Old March 17th, 2006, 12:32 PM
injate injate is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 6 injate User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 29 m 35 sec
Reputation Power: 0
I'm betting it's your first two lines being interpreted as PHP since <? ?>is a quick start php tag. Echo those through php instead of trying to plain text display them outside of php. I actually just started really getting into WML today but the below header is working under firefox's WML extention. I haven't tested it on a phone yet.

PHP Code:
<?php 

header
("content-type: text/vnd.wap.wml; charset=iso-8859-1");

echo 
"
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN&\" 
\"http://www.wapforum.org/DTD/wml_1.1.xml\">
"
;
?>

I don't know much about header info so I can't say if the extra ones you're using are correct or not.

Last edited by jabba_29 : March 17th, 2006 at 08:56 PM.

Reply With Quote
  #3  
Old March 17th, 2006, 05:02 PM
meangene01 meangene01 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 2 meangene01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 34 sec
Reputation Power: 0
Yeah I tried that before posted here. It doesn't work on my phone--maybe it does on otheres...I'll keep banging away then...

Reply With Quote
  #4  
Old March 17th, 2006, 09:02 PM
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,660 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 1 h 21 m 33 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
Welcome to Dev Shed

Quote:
Includes extensive support for web standards.

Compliant with Internet standards—HTML 4.01, xHTML 1.0, cHTML, WML 1.3, SSL 3.0, HTTP 1.1, JavaScript 1.5, CSS 1.0 and 2.0 (partial), GIF, animated GIF, JPEG, PNG, BMP and Cookies.

Try changing your page to something like:
PHP Code:
<?php 
header
("content-type: text/vnd.wap.wml; charset=iso-8859-1");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache"); 
echo 
'<?xml version="1.0"?>';
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" 
"http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<card id="card1" title="hello">
  <p>
  <?php
    
echo 'Hello World!';
  
?> 
</p>
</card>
</wml>

Maybe it isn't recognizing the DTD previously(?)

Since your device handles xhtml, why not write in that - it's a lot more versatile than WML.
Comments on this post
G00SE agrees!
andymoo agrees: Yup
__________________
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.

__________________

Last edited by jabba_29 : March 17th, 2006 at 09:14 PM.

Reply With Quote
  #5  
Old March 29th, 2006, 09:29 AM
Darren996 Darren996 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 2 Darren996 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 17 sec
Reputation Power: 0
That should work. Next try and validate it here: http://validator.w3.org/

Reply With Quote
  #6  
Old June 11th, 2006, 01:36 PM
noxhanti noxhanti is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 23 noxhanti User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 19 m 48 sec
Reputation Power: 0
Did you find an answer? If so could you post it as I have the same problem. The only way I can access a php file (saved without the headings) is through another file like the one below (saved as a .wml file)
Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">

<wml>
  <card id="card1" title="customer">
    
    <p>
      Customer Details.<br/>
     

      <anchor>
        <go method="get" href="whateveryour fileis.php">
         
        </go>
        Submit Data
      </anchor>
    </p>
  </card>
</wml>

Reply With Quote
  #7  
Old July 25th, 2006, 01:58 PM
Zobh Zobh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 2 Zobh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 39 sec
Reputation Power: 0
Send a message via ICQ to Zobh Send a message via AIM to Zobh Send a message via MSN to Zobh Send a message via Yahoo to Zobh
Smile

Try following code:

PHP Code:
<?php
// send wml headers
header("Content-type: text/vnd.wap.wml");
echo 
'<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">'
;
?>
<wml>
<card id="card1" title="hello">
  <p>
  <?php
            
print "Hello World!";
  
?>
</p>
</card>
</wml>


It should work on your phone too. Most of the times the reason a WML page is not being rendered on the mobile device is that it is not in the standard form(Not Validated).

I am currently working on YaSUS! [ http://yasus.info ] which is the WAP enabled Short URL service. I was having similar problem in the starting, but later after proper validation I got it to work. You may see YaSUS! in action by navigating to http://snip.ws via your WAP enabled device.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Dynamic PHP with WML


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 2 hosted by Hostway