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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old March 18th, 2008, 08:28 AM
sarrajhsr sarrajhsr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 13 sarrajhsr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 51 m 46 sec
Reputation Power: 0
WML - PHP program display problem, help please

i am new to wml. i have created on wml whcih contain PHP code inside it. when i run it in emulator only wml part is diplaying. PHP part is not displaying ....
can any one tell me what is the problem?

Reply With Quote
  #2  
Old March 18th, 2008, 08:38 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,571 jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th 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 2 Days 9 h 29 m 36 sec
Reputation Power: 1494
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
Hi, welcome to Dev Shed.

You will need to give a bit more information. Such as:

Does your page have a .php extension or are you making .wml parse as PHP?
What content-type headers are you sending to the browser/emulator?

Can you show your relevant 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.

__________________

Reply With Quote
  #3  
Old March 18th, 2008, 11:37 PM
sarrajhsr sarrajhsr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 13 sarrajhsr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 51 m 46 sec
Reputation Power: 0
Quote:
Originally Posted by jabba_29
Hi, welcome to Dev Shed.

You will need to give a bit more information. Such as:

Does your page have a .php extension or are you making .wml parse as PHP?
What content-type headers are you sending to the browser/emulator?

Can you show your relevant code?


thanks for the reply....

I am saving with .wml extension and parse as PHP. Code is as follows:

Code:
<?php 
// send wml headers 
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="Hello World!"> 
<p> 
<p>
   Welcome...
  </p>
<?php 
echo "hello";
$the_date = date("M d Y"); 
echo $the_date; 
echo "<br/>Welcome to a PHP-enabled site!"; 
?> 
<p>
after date
</p>
</p> 
</card> 
</wml> 


I don't know whether it is correct ot not. If any thing is wrong please help me and please tell how to check the out in web browser and in emulator..

thanks in advance...

Reply With Quote
  #4  
Old March 19th, 2008, 12:41 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,571 jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th 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 2 Days 9 h 29 m 36 sec
Reputation Power: 1494
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
Your code is incorrect. You haven't escaped the "quotes" properly -
best using 'single quotes' IMHO.

You have a tag-soup too. Incorrectly nested <p>paragraphs</p>

You can get a firefox extension to check in a web browser.
Opera allows you to view wml pages too..
php Code:
Original - php Code
  1. <?php
  2. // send wml headers
  3. header ('Content-type: text/vnd.wap.wml');
  4. echo '<?xml version="1.0"?>
  5. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
  6. "http://www.wapforum.org/DTD/wml_1.1.xml">'."\n";
  7. ?>
  8. <wml>
  9. <card id="card1" title="Hello World!">
  10.  
  11. <p>Welcome...</p>
  12.  
  13. <?php
  14. echo '<p>';
  15. echo "hello ";
  16. $the_date = date("M d Y");
  17. echo $the_date;
  18. echo "<br/>Welcome to a PHP-enabled site!";
  19. echo '</p>';
  20. ?>
  21.  
  22. <p>after date</p>
  23.  
  24. </card>
  25. </wml>
HTH.

Reply With Quote
  #5  
Old March 19th, 2008, 02:16 AM
sarrajhsr sarrajhsr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 13 sarrajhsr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 51 m 46 sec
Reputation Power: 0
Quote:
Originally Posted by jabba_29
Your code is incorrect. You haven't escaped the "quotes" properly -
best using 'single quotes' IMHO.

You have a tag-soup too. Incorrectly nested <p>paragraphs</p>

You can get a firefox extension to check in a web browser.
Opera allows you to view wml pages too..
php Code:
Original - php Code
  1. <?php
  2. // send wml headers
  3. header ('Content-type: text/vnd.wap.wml');
  4. echo '<?xml version="1.0"?>
  5. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
  6. "">'."\n";
  7. ?>
  8. <wml>
  9. <card id="card1" title="Hello World!">
  10.  
  11. <p>Welcome...</p>
  12.  
  13. <?php
  14. echo '<p>';
  15. echo "hello ";
  16. $the_date = date("M d Y");
  17. echo $the_date;
  18. echo "<br/>Welcome to a PHP-enabled site!";
  19. echo '</p>';
  20. ?>
  21.  
  22. <p>after date</p>
  23.  
  24. </card>
  25. </wml>
HTH.



Hi ,

still i am getting the same result in emulator such as Welcome...
after date.
can you help to see the output with the date displaying between welcome and after date.
if i check the out in opera i am getting the error as
ML parsing failed: syntax error (Line: 4, Character: 27)

Reparse document as HTML
Error:unexpected text (non-whitespace text outside root element)
Specification)
1: <?php
2: // send wml headers
3: header("Content-type: text/vnd.wap.wml");
4: echo "<?xml version="1.0"?>";
5: echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""
6: . " "">";
7: ?>
8: <wml>

please help me ....

thanks in advance.....

Reply With Quote
  #6  
Old March 19th, 2008, 02:58 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,571 jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th 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 2 Days 9 h 29 m 36 sec
Reputation Power: 1494
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
Copy and paste the code I provided you!!

You have the same errors as the original snippet you posted.
Are you sure that the page is being parsed as php??

Reply With Quote
  #7  
Old March 25th, 2008, 05:39 AM
sarrajhsr sarrajhsr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 13 sarrajhsr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 51 m 46 sec
Reputation Power: 0
Quote:
Originally Posted by jabba_29
Copy and paste the code I provided you!!

You have the same errors as the original snippet you posted.
Are you sure that the page is being parsed as php??


Hi,
Sorry for the late reply...

when i save the file as .php it is working fine in emulator but when i save as .wml it is not displaying the PHP part. all these result is observed in wamp5 server.
can u give me any suggestion?

Reply With Quote
  #8  
Old March 25th, 2008, 08:30 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,571 jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th 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 2 Days 9 h 29 m 36 sec
Reputation Power: 1494
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
Well, if it not parsing the .wml it means that your server isn't configured to do so.

You can:
a) change to .php or
b) configure apache to treat .wml as php -
this may lead to slight rise in overhead...
See this post on how to configure apache

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > WML - PHP program display problem, help please


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