A
A
Andrew2013-01-07 10:12:37
iPhone
Andrew, 2013-01-07 10:12:37

How can the server determine that the user has accessed the site from a touchscreen phone or tablet?

Is there any simple and universal way in PHP?

Answer the question

In order to leave comments, you need to log in

10 answer(s)
A
Antelle, 2013-01-07
@Antelle

Styles must be applied using css media queries and nothing else. Any analysis of user agents is from the evil one.

S
SazereS, 2013-01-07
@SazereS

+1 to media queries, smoke here: habrahabr.ru/post/119127/

M
MT, 2013-01-07
@MTonly

This should be defined on the client side:

function isTouchDevice() {
  try {
    document.createEvent('TouchEvent');
    return true;
  }
  catch(e) {
    return false;
  }
}

M
Marfapr, 2013-01-07
@Marfapr

detectmobilebrowsers.com/

D
dezconnect, 2013-01-07
@dezconnect

And actually why?

N
niko83, 2013-01-07
@niko83

api.yandex.ru/detector/

The Yandex.Detector API provides the ability to determine the model and characteristics of a site user's mobile device using the headers of HTTP requests sent by the user's device browser

F
Flasher, 2013-01-22
@Flasher

habrahabr.ru/post/144003/

S
Sergey Cherepanov, 2013-01-07
@fear86

wurfl.sourceforge.net/

A
Alexander, 2013-01-08
@Alexx_ps

People do this api.yandex.ru/detector/ and don't worry.

T
tinigin, 2013-04-03
@tinigin

mobiledetect.net/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question