Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreMobile 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:
  #1  
Old April 7th, 2002, 03:16 PM
Domisedon's Avatar
Domisedon Domisedon is offline
My beer is empty....
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: South Africa
Posts: 66 Domisedon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 20 sec
Reputation Power: 7
Creating WAP pages with PHP

I am busy developing a site that will need to be accessed by both WAP and normal browsers. The normal browser access is OK and the site is finished for that - now comes to big problem:

I need to create content based on a MySQL database for use on WAP, my only means of accessing the MySQL db is using PHP from a Linux server. I've tried a test that is supposed to display Hi on the WAP browser. This does not work it gives me the following error:
Unsupported content type: text/html
The code below is the original code I tried. After that I included Header("Content-type: text/wml"); with Content-type changing from text/wml to text/xml to xml to wml to xml/wml to no avail.

<?

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

<wml>
<template>
<do type=\"options\" name=\"prev\" label=\"Back\">
<prev/>
</do>
</template>
<card title=\"Page Title\" id=\"first\">
<p align=\"center\">Hi</p>
</card>
</wml>
";

?>


Your help would be greatly appreciated

Reply With Quote
  #2  
Old April 7th, 2002, 04:10 PM
topls64 topls64 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Chicago, IL
Posts: 5 topls64 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
you want something more like this....

<?
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>
<template>
<do type="options" name="prev" label="Back">
<prev/>
</do>
</template>
<card title="Page Title" id="first">
<p align="center">Hi</p>
</card>
</wml>


The stuff inbetween the <? ?> is php, outside is WML. Not the line that reads
header("Content-type: text/vnd.wap.wml");
This tells the client browser that WML follows. Note - you'll need a wml browser to view your pages.

Reply With Quote
  #3  
Old April 7th, 2002, 04:51 PM
Domisedon's Avatar
Domisedon Domisedon is offline
My beer is empty....
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: South Africa
Posts: 66 Domisedon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 20 sec
Reputation Power: 7
Thanks topls64 - now I can finish (at last)

Reply With Quote
  #4  
Old April 7th, 2002, 05:09 PM
topls64 topls64 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Chicago, IL
Posts: 5 topls64 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Just note the bottom have of the example I gave was in wml. You can, however, output the wml via php, like this....


PHP Code:
echo "<card id=\"results\" title=\"Search\">\n"
    
.  "  <p>\n"
    
.  "    Your search for \"<b>" stripslashes($seQuery) . "</b>\" returned no results. "
    
.  "Use the back button to try again.\n"
    
.  "  </p>\n"
    
.  "</card>\n" 


This allows you to add variables, etc....

Reply With Quote
  #5  
Old April 7th, 2002, 05:14 PM
Domisedon's Avatar
Domisedon Domisedon is offline
My beer is empty....
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: South Africa
Posts: 66 Domisedon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 20 sec
Reputation Power: 7
Figured that.

Thanks anyway

Reply With Quote
  #6  
Old January 8th, 2008, 07:49 AM
kikloo kikloo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 6 kikloo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 46 sec
Reputation Power: 0
Hi,

How do i view the pages ? Also do i name the pages as mypage.wml or mypage.php ? I am on CPanel based server and I have same issues. I have now created a sample page using the code provided above but i don't know what extension to give it ? Please help.

Thanks.

Reply With Quote
  #7  
Old January 8th, 2008, 08:57 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,788 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 6 Days 14 h 2 m 31 sec
Reputation Power: 1640
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 kikloo, welcome to Devshed!

In future please do not dig up posts that are this old -
please use a bit of common sense.
Your questions aren't even relevant to the original post..

Anyway, to answer your questions:
1: How do i view the pages ? FAQ #5
2: Also do i name the pages as mypage.wml or mypage.php -up to you, provided that you can get your server to parse .wml as php it doesn't matter
3: I am on CPanel based server and I have same issues. Probably your php isn't working if you are using short_tags (<?) -
see recent threads in the PHP forum about this: one to get you started

WAP is not that useful these days anyway,
you may want to investigate XHTML MP, see WAP Resources for more info.

HTH and good luck.
__________________
Cheers,

Jamie

# mdb4u | The mobile movie database | Please help to test and promote
# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# guidelines | search | wap resources | not getting help | fold to cure

__________________

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 - MoreMobile Programming > Creating WAP pages 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 6 hosted by Hostway