How can I determine whether the access end is a computer or a mobile phone ?. Currently, there are three opinions on the Internet: one is the User-Agent sent based on the browser, but this method obviously does not work. although some people list
We often need to determine whether a mobile phone is accessed and then perform automatic jump operations. this is a function separated from a PHP framework to determine whether it is a mobile phone, sharing is sometimes very useful in some occasions.
// If HTTP_X_WAP_PROFILE exists, it must be a mobile device. // if the via information contains wap, it must be a mobile device. some service providers will block this information. // Determine the client ID sent by the mobile phone, compatibility
In PHP, HTTP_USER_AGENT is used to determine whether it is the function code of the mobile terminal. Sometimes it is very useful in some scenarios. keep the slave copy code as follows: functionis_mobile_request () {$ _ SERVER [ALL_HTTP] isset ($ _
The implementation result of the following code:
1. the guest with the message displays the welcome word2. General visitor source prompt3. Do not leave a message to the diving Party (refresh more than 7 times and urge the message)4. Push update tips
Use PHP to determine whether the mobile phone or PC Access is a function example, pc example
Preface
Recently, in the Development Project, the PC and mobile terminals were developed respectively. To achieve this, when accessing the WWW domain name
This article provides a detailed analysis of PHP and browser cache. For more information, see the various optimization solutions on the server.
Client CacheTo be precise, it is the browser cache mechanism.
In fact, each browser has a cache policy,
$ _ SERVER ['php _ SELF '] # File Name of the script being executed, which is related to document root.$ _ SERVER ['argv'] # parameters passed to the script.$ _ SERVER ['argc '] # contains the number of command line parameters passed to the Program (
This article mainly shares with you a very useful phpheader downloading function. For more information, see
The code is as follows:
/**
* Send a file
*
* @ Author: legend (legendsky@hotmail.com)
* @ Link: http://www.ugia.cn /? P = 109
* @
In php, you can determine whether a request is an ajax request or a common request. Pathtopkphp. comscript. php? Ajax uses the following method in the php script: the code for copying the code is as follows: if (isset ($ _ GET [ajax]) {... this is
In php, how does one determine whether a webpage request is an ajax request or a common request? You can achieve this by passing parameters, for example, using the following URL to request Ajax
/Path/to/pkphp.com/script.php? Ajax
Use the following
Some SERVER information is often used in PHP programming. the detailed parameters of $ _ SERVER are sorted out for future use. Some SERVER information is often used in PHP programming. the detailed parameters of $ _ SERVER are sorted out for future
$ _ SERVER array element description bitsCN.com
$ _ SERVER array element description
$ _ SERVER ['php _ SELF '] # file name of the script being executed, which is related to document root.
$ _ SERVER ['argv'] # parameters passed to the script.
$ _
This article introduces the usage of various parameters of $ _ SERVER environment variables. For more information, see this article.
$ _ SERVER ['php _ SELF ']: relative to the path of the website root directory and the PHP program name, it is
SERVER variables $ _ SERVER summary:
$ _ SESSION ['php _ SELF '] -- get the file name of the script being executed.
$ _ SERVER ['server _ Protocol'] -- name and version of the communication PROTOCOL used to request the page. For example, "HTTP/
The simplest way to get the client IP address is to directly use REMOTE_ADDR, but this kind of IP address cannot be obtained if there is a proxy IP address, so we need to use HTTP_X_FORWARDED_FOR to obtain it, next, I will introduce you to a
With the popularization of Internet mobile devices, many websites are compatible with mobile browsing. To better display webpages on mobile phones, we have chosen to use CSS media queries to create responsive templates. This article introduces PHP
Variable: $ _ SERVER, used in PHP 4.1.0 and later versions. For earlier versions, use $ HTTP_SERVER_VARSVariable: $ _ ENV, used in PHP 4.1.0 and later versions. For earlier versions, use $ HTTP_ENV_VARSVariable: $ _ COOKIE, used in PHP 4.1.0 and
We often optimize cache settings on servers, but we seldom notice thatClient CacheTo be precise, it is the browser cache mechanism.In fact, each browser has a cache policy, which temporarily caches each browsed file in a special folder. When you
This article provides a detailed analysis of the SERVER variable $ _ SERVER. For more information, see
This article provides a detailed analysis of the SERVER variable $ _ SERVER. For more information, see
In-depth analysis of the SERVER
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.