Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingMobile 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 February 3rd, 2011, 08:34 AM
willy155 willy155 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2010
Posts: 51 willy155 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 24 m 24 sec
Reputation Power: 4
Device detection help

I have found detectmobilebrowsers.mobi after having read part of my Mobile Web Design for Dummies book and have generated the function below which I hope (if I'm going about it the right way)

Code:
require_once('mobile_device_detect.php');

mobile_device_detect(true,false,true,'[some URL]',true,true,true,false,false);


So far I have to very basic html pages with just some plain text in them with my intended desktop version and mobile version in a different folder (I am using the Nokia 2730 for the time being which uses the OperaMini Browser). I have 2 questions:

1) should my pages have the .html or .php extensions?
2) where should those 2 lines go exactly in the code for it to detect my nokia device and re-direct appropriately?

I tried it using the .html extension and my phone displayed the desktop version when I was hoping it would display the mobile version.

When using the .html extension I have found that the PHP function which I had put in the 'head' section of the page was actually being displayed as text at the top of the page when viewing on a desktop computer (the phone just displayed the normal desktop text).

When I changed the desktop version to .php it failed to work on both my phone and a desktop computer.

I appreciate this may be a 'noob problem' but right now I most certainly am a noob when it comes to Mobile Web Design

Last edited by willy155 : February 3rd, 2011 at 09:07 AM. Reason: More details discovered

Reply With Quote
  #2  
Old February 4th, 2011, 06:44 AM
willy155 willy155 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2010
Posts: 51 willy155 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 24 m 24 sec
Reputation Power: 4
Have discovered why it wasn't working...I read the 'see support' section of that website and it informed me through the "How do I make this work on my HTML pages?" FAQ with the answer:

Problem
Quote:
HTML is code the end user's browser will process and PHP is something that the webserver will process, including PHP in HTML pages isn't going to work and will just show the function in the page unless the server is instructed otherwise.

Solution

Assuming you're hosting in an Linux environment you can add the following to your .htaccess file which will instruct the server to execute PHP inside HTML and HTM pages.

AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
AddHandler x-httpd-php .html .htm .cgi .php

Your webhost will need support for PHP and .htaccess - please contact your host direct to address these issues.

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingMobile Programming > Device detection help

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap