English 中文(简体)
建立一个能够适应讲人的网站
原标题:Make a website adaptable for iphone

I am owning some websites, in php, java and html coded. I want them to be viewed comfortably using iphones. ie, the site has to first check whether the site is hit from a pc or mobile (iphone). If its from a mobile, it has to be redirected to another server which loads the mobile view. Some sites i ve recently found of doing the same is orkut, facebook,etc. While logging in from a mobile, we are redirected to m.orkut.com from www.orkut.com, i ve to do something similar to that.

最佳回答

用户-代理人的核对*

$_SERVER["HTTP_USER_AGENT"]

转口

header("location: http://mobile.mysite.com");

必要时。

<><> 代码> 值得注意的是,“i”有许多用户,因此,在进行准确比较时核对插图本身是实用的。 相反,寻找像“iPhone”和“Mobile”这样的扼杀物,以确定目前的访客是“iPhone”的。

问题回答

检查用户代理人。 如果含有“MobileSafari”或“iPhone”,则含有“ iPhoneSafari”。 其他装置当然需要不同的检查。 谷歌可以用来寻找准确的用户,但可以警告它们改变每个单版。

PHP代码改为:

header("Location: http://your-desired.site.com/");




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签