Home > front end >  The great god mobile and PC is the same link content is not the same as how to implement
The great god mobile and PC is the same link content is not the same as how to implement

Time:10-05

O great spirit action is mobile and PC belong to a URL with no HTML

CodePudding user response:

Framework seems to be getting the screen width of judgment, and then, you get information about browser, and see if I can find the related things from the inside

CodePudding user response:

Then you can use under a system if it is a PC you will open a content, if it's an android or ios you open another

CodePudding user response:

Via the URL, pass different parameters, judging from the PC or mobile, oriented to different pages, page with adaptive tough, beautiful degree

CodePudding user response:

The simplest way is to write two kinds of style, and then get the size of the screen to determine in which a set of,

CodePudding user response:

4 hug positive solutions; Be adaptive, access to the same page content can be done

CodePudding user response:

CSS control! Show/hide, that is what I do

CodePudding user response:

Apache2 KTTPD. Conf is amended as:
 & lt; IfModule dir_module & gt; 
DirectoryIndex index. PHP index. HTML index. The HTML index. The asp
index. PHP is:
 & lt; ? PHP 
If (isset ($_SERVER [' HTTP_USER_AGENT '])) {
$clientkeywords=array (' nokia ', 'SONY', 'Ericsson', 'mot,
'samsung', 'HTC', 'SGH', 'lg', 'sharp'
'sie -', 'philips',' panasonic, alcatel,
'lenovo', 'the', 'ipod', 'blackberry,
'meizu', 'android', 'netfront', 'symbian,
'ucweb', 'windowsce', 'palm', 'operamini'
'operamobi', 'openwave', 'nexusone', 'CLDC,
'midp', 'a wap', 'mobile'
);
If (preg_match ("/". The implode (' | ', $clientkeywords). ")/I ", strtolower ($_SERVER [' HTTP_USER_AGENT ']))) {
/* method one: read the mobile end file:
$file_path="index_mb. HTML";
{if (file_exists ($file_path))
$STR=file_get_contents ($file_path);
Echo $STR;
}
Method 2: direct output: */
Echo '





<body>
The mobile end page & lt;/span>


';
} else {
/* method one: PC read file:
$file_path="index.html";
{if (file_exists ($file_path))
$STR=file_get_contents ($file_path);
Echo $STR;
}
Method 2: direct output: */
Echo '





<body>
PC page & lt;/span>


';
}
} else {
//echo 'unknown client;
}
?>
request address such as: http://127.0.0.1/
  •  Tags:  
  • IIS
  • Related