“VIEW FULL SITE” mobile site option

前端 未结 5 1726
别跟我提以往
别跟我提以往 2020-12-15 01:41

So I\'m working on the mobile version of a site I\'m doing, and so far, I\'m pulling the mobile sites content from its main counterpart, the main site.

As I study s

5条回答
  •  太阳男子
    2020-12-15 02:26

    Use PHP to detect mobile users through $_SERVER['HTTP_USER_AGENT']. JavaScript detection may not be reliable, because many mobile browsers do not support JS. A "View Full Site" will set a cookie to reject mobile site, which is detectable. Use cookies to keep track of your user's preferences.

    In skeleton

    For the "View Full Site" page:

    Full Site
    

    fullsite.php

    
    

提交回复
热议问题