Re: Serving content for hand held devices and phones?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
My first post here, so be gentle :)
I'm doing exactly this - downloading java apps to mobile phones, which can then access content at the same URL using http. My technique is to pull apart the User-Agent header (see docs for BrowserMatch), then use some php to crunch the results. (The crunching could be done without php, but I'm going there for other reasons...)

[Snippet from <VirtualHost> <Directory>]
         BrowserMatch "Profile/MIDP-([0-9]\.[0-9])" midp=$1
         BrowserMatch "Configuration/CLDC-([0-9]\.[0-9])" cldc=$1

[isphone.php - included as appropriate]
<?php
# work out what the client is
$cldc = apache_getenv("cldc");
$midp = apache_getenv("midp");
if ($cldc == "1.1" && $midp == "2.0")
   $agent = "OK phone";
else
   $agent = "Computer or bad phone";
?>

Hope this is useful (even though incomplete)
Peter


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux