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 February 22nd, 2004, 02:07 PM
cabbagelad33 cabbagelad33 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 cabbagelad33 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
unable to generate WML with PHP

Hi,

I am trying to generate WML with PHP. i have added this line to my httpd.conf:

AddType*application/x-httpd-php*.wml

and am testing this simple script (test.wml):

<?
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");
?>

<wml>
<card id="card1" title="Example 1">
<p>
Hello World
</p>
</card>
</wml>

However i get this... 500: Web service problem: Please contact the service provider.

any ideas why this is not working?

thanks for any help

Reply With Quote
  #2  
Old March 10th, 2004, 01:10 AM
ChiralSoftware ChiralSoftware is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Beverly Hills
Posts: 45 ChiralSoftware User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to ChiralSoftware
Oh no!

No no no! Take out the AddType directive. Here is what is happening:

You have just set it up so that the server hands all .wml files over to the PHP module (take a look at: http://chiralsoftware.net/manual/ma...ternalreference if you want to learn more than you wanted to know about this).

So, all .wml gets handed over to the PHP interpreter, which then sets the mime type to its default MIME type and then executes the script. Problem: PHP's default mime type is text/html. So, by putting in that AddType all of your .wml files are interpreted as PHP and all of them get the default PHP mime type. Neither of these are what you want most likely.

Now, you are probably about to say right now "but I put the Header command in which would set the content type correct even so." Maybe! Maybe maybe. The problem is that if there is any output before the header command, the header command has no effect (as far as I remember). This means that if there is a space or a return, that header command isn't doing anything.

So, take out the AddType, rename your file to a .php file, and make sure there are no spaces or output of any kind before the Header directive is reached. PHP may also have a set-content-type directive that you can use without having to manipulate the header directly.

-----------
WAP hosting

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > unable to generate WML with PHP


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