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 April 17th, 2008, 03:39 AM
AdamCox9 AdamCox9 is offline
this & that developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Location: Boston
Posts: 145 AdamCox9 User rank is Lance Corporal (50 - 100 Reputation Level)AdamCox9 User rank is Lance Corporal (50 - 100 Reputation Level)AdamCox9 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 15 h 29 m 8 sec
Reputation Power: 1
Bebo Facebook MySpace Orkut
Can't serve XHTML-MP with PHP

I can get an index.xhtml file to work which is valid XHTML-MP. However, when I change the extension to .php it give 500 internal server error.

I tried to set the header to both the XHTML-MP headers and the standard XHTML headers and no luck with either attempts.

Could this mean that my server does not support the XHTML-MP MIME type? I know that XHTML works on my server and I think that XHTML-MP is a subset of XHTML so shouldn't it work if I serve it as XHTML.

Can anyone help me with this? Thanks!

My site is at http://mobi.randomthoughts.ws/

Sample XHTML page works OK:

http://mobi.randomthoughts.ws/index.xhtml

Reply With Quote
  #2  
Old April 17th, 2008, 08:15 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
I get a blank page, absolutely no output on http://mobi.randomthoughts.ws

For the index.xhtml page, you should add the following within the <head> of the document:
html4strict Code:
Original - html4strict Code
  1. <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />


As for your 500 error:
Have you made any changes to .htaccess or server?
Can you use PHP normally?
__________________
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 April 17th, 2008, 08:41 AM
AdamCox9 AdamCox9 is offline
this & that developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Location: Boston
Posts: 145 AdamCox9 User rank is Lance Corporal (50 - 100 Reputation Level)AdamCox9 User rank is Lance Corporal (50 - 100 Reputation Level)AdamCox9 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 15 h 29 m 8 sec
Reputation Power: 1
Bebo Facebook MySpace Orkut
I have no problems with using PHP on my server...many, many PHP files are working flawlessly.

The XHTML-MP checks out:

http://validator.w3.org/check?uri=h...=Inline&group=0

Here is my PHP file that I am trying to execute:

Code:

<?PHP 
header('Content-type: application/vnd.wap.xhtml+xml');
?><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> 
<title>City Guide</title>
	<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p>
<img src="meal.gif" alt=""/><b>Restaurants:</b><br/>
Your current location is Market Street, San Francisco.<br/>
Choose restaurants within 1 mile:
</p>
<table>
<tr class="blue">
<td><p class="nowrap">1 <a accesskey="1" href="find.html">American (2 Restaurants)</a></p></td>
</tr>
<tr>
<td><p class="nowrap">2 <a accesskey="2" class="bluetext" href="find.html">Chinese (2 Restaurants)</a></p></td>
</tr>
<tr class="blue">
<td><p class="nowrap">3 <a accesskey="3" href="find.html">Frence (2 Restaurants)</a></p></td>
</tr>
<tr>
<td><p class="nowrap">4 <a accesskey="4" class="bluetext" href="find.html">Italian (2 Restaurants)</a></p></td>
</tr>
<tr class="blue">
<td><p class="nowrap">5 <a accesskey="5" href="find.html">Japanese (2 Restaurants)</a></p></td>
</tr>
<tr>
<td><p class="nowrap">6 <a accesskey="6" class="bluetext" href="find.html">Mexican (2 Restaurants)</a></p></td>
</tr>
</table>
<p><a class="darkblue" href="more.html">More</a>
</p> 
</body>
</html>


Do I need to have MIME type for XHTML-MP installed in PHP? I've never dealt with that before.

Reply With Quote
  #4  
Old April 17th, 2008, 10:03 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
No you shouldn't have to.

Have you tried echoing the XML declaration -
if PHP has short tags enabled it can get confused.
php Code:
Original - php Code
  1. <?php
  2. header('Content-type: application/vnd.wap.xhtml+xml');
  3. echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
  4. ?>

Saying that, don't know why you get a 500 error -
that should throw a parse error..

Would question your use of tables in this instance,
but that is another issue..
Comments on this post
AdamCox9 agrees: cool

Last edited by jabba_29 : April 17th, 2008 at 10:08 AM.

Reply With Quote
  #5  
Old April 17th, 2008, 11:14 AM
AdamCox9 AdamCox9 is offline
this & that developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Location: Boston
Posts: 145 AdamCox9 User rank is Lance Corporal (50 - 100 Reputation Level)AdamCox9 User rank is Lance Corporal (50 - 100 Reputation Level)AdamCox9 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 15 h 29 m 8 sec
Reputation Power: 1
Bebo Facebook MySpace Orkut
Cool. Here is a working PHP template to output XHTML-MP. It is validated here http://validator.w3.org/check?uri=http%3A%2F%2Fmobi.randomthoughts.ws%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

I am not using the:

header('Content-type: application/vnd.wap.xhtml+xml');

for now so I can test it in the browser. Should I use that later on? I have seen a couple of articles on HTTP_ACCEPT to test whether the browser will accept it or not. IE tries to "open" the XHTML files. FF can handle it appropriately. This is just a template that has nothing to do with my website, but I am going to get the content now and fill in this little template. I will post back once I get the PHP running in this template, validate it through W3C, and test it on a couple of mobile phones.

Does anybody have any "gotchas" that I should be weary about like this one for what I am doing?

Code:
<?php
//      header('Content-type: application/xhtml+xml');
      echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> 
<title>City Guide</title>
	<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p>
<img src="meal.gif" alt=""/><b>Restaurants:</b><br/>
Your current location is Market Street, San Francisco.<br/>
Choose restaurants within 1 mile:
</p>
<table>
<tr class="blue">
<td><p class="nowrap">1 <a accesskey="1" href="find.html">American (2 Restaurants)</a></p></td>
</tr>
<tr>
<td><p class="nowrap">2 <a accesskey="2" class="bluetext" href="find.html">Chinese (2 Restaurants)</a></p></td>
</tr>
<tr class="blue">
<td><p class="nowrap">3 <a accesskey="3" href="find.html">Frence (2 Restaurants)</a></p></td>
</tr>
<tr>
<td><p class="nowrap">4 <a accesskey="4" class="bluetext" href="find.html">Italian (2 Restaurants)</a></p></td>
</tr>
<tr class="blue">
<td><p class="nowrap">5 <a accesskey="5" href="find.html">Japanese (2 Restaurants)</a></p></td>
</tr>
<tr>
<td><p class="nowrap">6 <a accesskey="6" class="bluetext" href="find.html">Mexican (2 Restaurants)</a></p></td>
</tr>
</table>
<p><a class="darkblue" href="more.html">More</a>
</p> 
</body>
</html>

Reply With Quote
  #6  
Old April 17th, 2008, 11:20 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
Gotchas:
- tables
- you should send as "application/xhtml+xml" if the device can handle it.

However, invalid code (tag soup) will break the page and it may not display.

Check out http://dev.mobi for more tips...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Can't serve XHTML-MP 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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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