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 May 4th, 2007, 03:53 PM
workaholic06 workaholic06 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2007
Posts: 2 workaholic06 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 13 sec
Reputation Power: 0
WAP and PHP - doesn't like the header('Content-type: text/vnd.wap.wml\n\n');

Hello,

I've been trying to get this working, but no luck. My phone is a Samsung m500

I've coded a page on my server to check to see if the header is for text/vnd.wap.wml, and if so, attempt to create the wml page.

If I include the php code:
header('Content-type: text/vnd.wap.wml\n\n');

my phone browser returns a msg:
The requested page cannot be displayed.

If I exclude the header line above, it displays the page, however, the <anchor> tag is not selectable.

If anyone can suggest a fix, or tell me what's wrong, I'd appreciate it.

You can view the page on your phone at: (URL address blocked: See forum rules)

This is the code I've setup for the wml:
PHP Code:
<?php
    session_start
();

$headers=apache_request_headers();

$pos strpos($headers['Accept'], "vnd.wap.wml");
if (
$pos === false) {
    
// stay on this page
} else {
    
header('Content-type: text/vnd.wap.wml\n\n');
    echo 
'<?xml version="1.0"?'.'>';
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "(URL address blocked: See forum rules)">

<wml>
  <card id="card1" title="User Login">
    <onevent type="onenterforward">
      <refresh>
        <setvar name="my_temp_id" value="123456"/>
      </refresh>
    </onevent>
    <p>
      Bingo Lotto Fun!<br/><br/>
      User Id: <input type="text" name="varname" maxlength="10" emptyok="false"/><br/>
      Password: <input type="password" name="varpswd" maxlength="6" emptyok="false"/><br/>

      <anchor>Login
        <go method="get" href="wapprocessing.php">
          <postfield name="clientname" value="$(varname)"/>
          <postfield name="clientpswd" value="$(varpswd)"/>
        </go>
      </anchor>
    </p>
  </card>
</wml>

<?php
    
die;
}

//... regular html code here


Thanks,

Robert

Reply With Quote
  #2  
Old May 4th, 2007, 08:34 PM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Click here for more information.
 
Join Date: Feb 2002
Location: Finland
Posts: 8,912 jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st 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 4 Weeks 1 Day 12 h 41 m 36 sec
Reputation Power: 1693
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
PHP Code:
 header('Content-type: text/vnd.wap.wml\n\n'); 

This will just add the characters, not create new lines -
though I don't know why you are trying to create new line.

If you really want to add new lines to the header, then you must use "double quotes" -
PHP Code:
<?php
header
("Content-type: text/vnd.wap.wml\n\n");
You may want to add , true to that line...
PHP Code:
<?php
header
('Content-type: text/vnd.wap.wml, TRUE');


see strings for more.

And make sure you validate your WML. See the WAP Resources thread for a tools list.

Welcome to Dev Shed, enjoy your stay ...
__________________
Cheers,

Jamie

# mdb4u | 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
  #3  
Old May 4th, 2007, 10:20 PM
workaholic06 workaholic06 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2007
Posts: 2 workaholic06 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 13 sec
Reputation Power: 0
Thank you jabba_29 ,

I had noticed the ' vs " issue with my \n characters, and had fixed that.

Once I added the ,TRUE to the header() stmt, that resolved the issue.

I did use the link for the validators for some other issues, I appreciate the links.

I'm not doing this any more

Grateful for your help.

Robert

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > WAP and PHP - doesn't like the header('Content-type: text/vnd.wap.wml\n\n');


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 1 hosted by Hostway
Stay green...Green IT