Today, I accidentally used a Samsung 5.5-inch mobile phone to watch the ecshop Mall. Oh, it's so ugly. I used a simulated tablet to access it. What's worse, I used the mobile phone version of ecshop, but there is no suitable tablet size, so if you look at it on the tablet, it is best to use the web version of the computer, under the ecshop root directory index. in the php file, a jump is made to determine whether the mobile phone version is accessed, but the process is not very good, so it is necessary to delete it. If you want to watch the mobile phone, we can install a QR code scan, you can also directly create a hyperlink. The following summer blog will teach you how to delete this code that is not well judged.
Open the index. php file in the root directory and find the following code:
$ Ua = strtolower ($ _ SERVER ['http _ USER_AGENT ']); $ uachar = "/(nokia | sony | ericsson | mot | samsung | sgh | lg | philips | panasonic | alcatel | lenovo | cldc | midp | mobile)/I "; if ($ ua = ''| preg_match ($ uachar, $ ua ))&&! Strpos (strtolower ($ _ SERVER ['request _ URI ']), 'wap') {$ Loaction = 'mobile/'; if (! Emptyempty ($ Loaction) {ecs_header ("Location: $ Loaction \ n"); exit ;}}
If you do not know about php, you can add a js code in the header of the htm page, as shown below:
// Determine whether it is a mobile running environment
If (/AppleWebKit. * Mobile/I. test (navigator. userAgent) | (/MIDP | SymbianOS | NOKIA | SAMSUNG | LG | NEC | TCL | Alcatel | BIRD | DBTEL | Dopod | PHILIPS | HAIER | LENOVO | MOT-| Nokia | SonyEricsson | SIE -| Amoi | ZTE /. test (navigator. userAgent) {if (window. location. href. indexOf ("? Mobile ") & lt; 0) {try {if (/Android | webOS | iPhone | iPod | BlackBerry/I. test (navigator. userAgent) {// Determine whether the access environment is Android | webOS | iPhone | iPod | BlackBerry loads the following style setActiveStyleSheet ("style_mobile_a.css");} else if (/iPad/I. test (navigator. userAgent) {// Determine whether the access environment is iPad. Load the following style setActiveStyleSheet ("style_mobile_iPad.css ");} else {// Determine if the access environment is another mobile device, load the following style setActiveStyleSheet ("style_mobile_other.css");} catch (e) {}}} else {// if none of the above are available, load the following style setActiveStyleSheet ("style_mobile_no.css");} // load the style function setActiveStyleSheet (filename) {document. write ("<link href =" + filename + "rel = stylesheet> ");}
As shown in the preceding figure, different css devices can be used to create websites that are fully compatible with device browsers.
Delete it or comment it out. This time, if you use a tablet to open it again, it will be a web page on your computer. There will be no wap-mode web pages or any wrong code.