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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 20th, 2004, 12:18 PM
cazino cazino is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 17 cazino Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 42 m 43 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Getting Php To Work On Wap Phone..please Help

HI, I have developed a simple wml page that pulls information from a sql database. The end user enters a reference number and all information stored relating to this reference should be displayed. THE FOLLOWING CODE WORKS ON SOME WAP EMULATORS BUT NOT ON PHONES...PLEASE HELP!!

HERE IS THE WML CODE:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="info 1" title="MyiNFO">
<p>
<anchor title="Getinfo">infoplease
<go method="post" href="http://www.example.com/htdocs/example.php">
<postfield name="ref" value="$(mine)"/>
</go>
</anchor>
refnoNo:
<input title="m" name="mine"/> <br/>
</p>
</card>
</wml>

THE ABOVE LOADS FINE!! BUT THE EXAMPLE.PHP FILE DOES NOT LOAD HERE IS THE CODE FOR example.php, this page should display the results of the above query based on the $mine variable. HERE GOES:

<?php
header("Content-type: text/vnd.wap.wml");
print ("<? xml version=\'1.0'\ encoding='iso-8859-1'?>");
print ("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n");


print ("<wml>\n");
print ("<card id=\"sent\" title=\"Mail sent\">\n");



$db = mysql_connect("localhost","cazino5","");
mysql_select_db("cazino5_uk_db",$db);
$query = "SELECT * FROM memtest WHERE email=".$mine;
$result = mysql_query ($query,$db);
$nrows = mysql_num_rows($result);
for ($i=0; $i < $nrows; $i++) {
$row = mysql_fetch_array($result);
print "<p>$row[email] <br/> $row[message] </p>";
}
mysql_free_result($result);

print ("</card>\n");
print ("</wml>\n");
?>
WHEN I POST TO THE ABOVE CODE NO RESULTS ARE DIPLAYED AND I GET DISPLAY ERROR MESSAGES.
NOTE:I have set my hosting server with the right php and wml mime types. Any help on this would be much appreciated.

Reply With Quote
  #2  
Old September 20th, 2004, 01:15 PM
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,660 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 4 Days 1 h 21 m 33 sec
Reputation Power: 1618
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
Change
PHP Code:
print ("<? xml version=\'1.0'\ encoding='iso-8859-1'?>"); 
to
PHP Code:
print ("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"); 
Alos quote your result vars
PHP Code:
print "<p>$row[email] <br/> $row[message] </p>";
// should be 
print "<p>"$row['email'] ."<br/>"$row['message'] ."</p>"

What errors do you get?
Have you tried validating the code a w3c?
__________________
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 September 21st, 2004, 08:06 AM
cazino cazino is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 17 cazino Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 42 m 43 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
THANKYOU still does not work!!

Hi thankyou for your quick response. I made the ammendments to my code as you suggested however, it still does not work. The errors im getting are different on each phone for example "seimens=unable to display page" "nokia= ERROR unable to load item requested".

I have tried it w3c however it comes up with first line errors due to the open php tag (<?php) syntax. w3c only tends to work with wml or xml headers.

Im using a remote lycos server and I have created and modified the .htaccess file with the following wap mime types:

AddType application/x-httpd-php .php4 .php .wml
AddType text/vnd.wap.wml wml
AddType application/vnd.wap.wmlc wmlc
AddType text/vnd.wap.wmlscript wmls
AddType text/vnd.wap.wmlscript wmlsc
AddType application/vnd.wap.sic sic
AddType text/vnd.wap.si si
AddType text/vnd.wap.sl sl

However the page is still not loading. im getting 'XML not well formed errors on line 9 column 1' any futher help would be very much appreciated.

Reply With Quote
  #4  
Old September 21st, 2004, 01:50 PM
cazino cazino is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 17 cazino Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 42 m 43 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Re Getting Php To Work (problem For Everyone It Seems!!)

Hi Just Wondered If Anyone Had A Universal Solution To This Problem Of Getting Php To Work With Wap. Looking Through This Forum It Seems A Lot Of People Have The Same Problem. We Have All Set The Correct Mime Types And Used The Correct Headers And It Still Seems None Of Us Can Get Php To Work On A Wap Enabled Handset. If Somebody Knows Ho To Do This Please Help.

Reply With Quote
  #5  
Old September 21st, 2004, 05:21 PM
tj_nt tj_nt is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Posts: 1,594 tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 9 h 11 m 22 sec
Reputation Power: 616
Quote:
Originally Posted by cazino
Hi Just Wondered If Anyone Had A Universal Solution To This Problem Of Getting Php To Work With Wap. Looking Through This Forum It Seems A Lot Of People Have The Same Problem. We Have All Set The Correct Mime Types And Used The Correct Headers And It Still Seems None Of Us Can Get Php To Work On A Wap Enabled Handset. If Somebody Knows Ho To Do This Please Help.



I use a php script to display local theater movie showtimes on my WAP site without any problems...

I am currently developing a php script to power a yellow page type database (mysql) search app. WML has always been unforgiving and incorporating php (also unforgiving) it makes it can be a bit of a task...but it is workable...

[another topic] I am having problems with links displaying on "smart phone" emulators... my code displays fine on wap 1.x phones and emulators but I can't get hyperlinks to display on wap 2.0 phones...?

what type of error messages are you getting?

Reply With Quote
  #6  
Old September 22nd, 2004, 07:53 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,660 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 4 Days 1 h 21 m 33 sec
Reputation Power: 1618
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 haven't had to do anything on any of my servers to get wap running.
Things to note, do Lycos add stuff to their pages, like adverts etc - this might be causing a problem. Also; try this is your header
PHP Code:
 header('Content-Type: text/vnd.wap.wml'true); 

Reply With Quote
  #7  
Old September 22nd, 2004, 08:34 AM
andymoo's Avatar
andymoo andymoo is offline
Timelord
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Loughborough, Leicestershire
Posts: 605 andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 5 h 53 m 46 sec
Reputation Power: 63
Yes I think Lycos and most free hosts add headers and footers to files for their own popups, banners and so on.
__________________
Andy Moore << oh no it's got a blog.....
Word Press WAP Plugin with Ad Mob Advertising revenue
PHP developer
deploying ringtones, mp3 downloads and realtones
I'm a geek who's obsessed with stats and gadgets

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Getting Php To Work On Wap Phone..please Help


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