|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
WAP WML, and PHP
Ok. First off I'd like to call myself above intermediate with PHP and MySQL (html css and all of that is implied). And I have encountered a task, where I have a dynamic version of a single page, that I need to also have a simple WAP version (an old Grayscale mobile device), will perform the same fetches from a MySQL database with PHP, and I want it to display to the WAP browser (via wml?). My problem is I am following this tutorial
http://www.developer.com/lang/php/article.php/10941_1449061_1 page 1 and 2 go smoothly (I'm using PHP 4.3.x MySQL 5.xx and IIS 6.0 i believe). I added the php.exe to the wml extension as per instructed on page 2 of that tutorial. I then make a test.wml with PHP Code:
That works and I can see it. However I don't want it to be http://www.mysite.com/test.wml I want to have it http://www.mysite.com which ofcourse loats index.php and within index.php it could have PHP Code:
But whenever i try to go to index.php through the wap browser on the mobile device, I get Error 406, Not Acceptable "Page not loaded because browser doesn't support" Any Ideas/Help PLEASE. |
|
#2
|
||||
|
||||
|
Try checking the strpos condition as !== FALSE.
Additionally, does blackberry support that old a version of wap? I would go for XHTML MP personally. Of course, if your domain loads index.php by default, why not do something like PHP Code:
This would be the wrong way according to dotmobi though. If it is not a mobile you should redirect, not the other way around. But anyway, hope that gives you a bit of an idea.
__________________
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. ![]() __________________ |
|
#3
|
|||
|
|||
|
Quote:
So then by default I should have my page go to index.wml? and if the browser isn't mobile, redirect it to index.php? Because I have the access to change the default page to index.wml instead of index.php. I'm just wondering how would I write it in the wml page to detect if its mobile or not... same way as I did in the PHP? |
|
#4
|
||||
|
||||
|
Your wml page doesn't need to be .wml. It can still be .php.
wml is just mark up language - it cannot detect what device is browsing the page. |
|
#5
|
|||
|
|||
|
so have my main page index.php,
and within that use WML, and if the device is a Desktop, I forward it to lets say desktop.php, otherwise I stay on index.php where my WML/WAP is? |
|
#6
|
||||
|
||||
|
Yes.
take a look at the dotmobi recommendations for device detection and redirection - they may help you a bit. I have written a Drupal module that renders content according to device. Andymoo has done similar with Wordpress. Check out the WAP Resources for links.. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Mobile Programming > WAP WML, and PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|