First of all, recommend a PHP lightweight identification class, mobile-detect specifically to identify whether the phone or PC-side access to the site, which can be based on the terminal type of access to the mobile browser to adapt to the Web site or PC Browser Web site.
Mobile-detect official website links as follows Mobiledetect
Sample links are as follows: Mobile-detect Example
The following is my simple jump adapter to the PC or the phone-side code:
<?php
require_once ' mobile_detect.php '; Note To introduce mobile_detect.php This class has a download link in the above connection
$detect = new Mobile_detect;
if ($detect->ismobile ()) {
header (' location:http://127.0.0.1/mobiledetect/mobiledetect/mobile.html ', true, );
echo "mobile";
} else{
Header (' location:http://127.0.0.1/mobiledetect/mobiledetect/pc.html ', true, a);
echo "PC";
>