Function:1. Get the current IP address,2. Call Sina API to obtain the current city.3. Convert Chinese to Pinyin and then jump.
Copy codeThe Code is as follows:Include './pinyin. php ';
// Obtain the current ip AddressFunction getIp (){$ Onlineip = ''
[Switch] Summary of super practical PHP functions and summary of practical php FunctionsOriginal article: http://www.codeceo.com/article/php-function.html1?php encryption and decryption
The PHP encryption and decryption function can be used to
This article mainly introduces how to share the php + curl sending Image Processing code. For more information, see
This article mainly introduces how to share the php + curl sending Image Processing code. For more information, see
// Upload
For example, if a piece of code I tested accesses an IP address query service, we can see that any forged IP address can be used! In a PHP project currently in progress, you need to verify whether the user's IP address is in the authorization scope.
13 PHP functions are super practical and 13 PHP Functions
1. PHP encryption and decryption
The PHP encryption and decryption function can be used to encrypt some useful strings and store them in the database. The function uses base64 and MD5
In nginx reverse proxy, thinkphp and php cannot obtain the correct Internet ip address. nginxthinkphp
When a user needs to obtain the user's ip address to send a text message, tp always obtains the Intranet ip Address: 10.10.10.10.
Tp framework ip
This article describes how to call Sina api based on ip addresses to obtain city names and convert them to pinyin. For more information, see the following functions:
1. get the current IP address,
2. call Sina API to obtain the current city.
3.
Phpsession and cookie usage instructions. 1. COOKIEcookie of PHP is a mechanism for storing data on a remote browser to track and identify users. PHP sends a cookie in the http header, so the setcookie () function must be 1. PHP COOKIE
Cookie is a
This article will share with you two practical functions of php for implementing the blacklist and whitelist, namely the security IP detection function and the function for obtaining the client IP address, I will not talk nonsense here. This is a
Some ideas about how to obtain the real ip address of the client are not necessarily correct, but at least the correct rate is much better.
The code is as follows:
Function GetIP (){
If (getenv ("HTTP_CLIENT_IP") & strcasecmp (getenv
How does php obtain the client ip address and the specific implementation code of the province and city .. Thank you .. ------ Solution ------------------ how many IP address APIs are provided? Sina's IP address query interface: int.dpool.sina.com.
PHP obtains the real IP address of a user.
/** Function for obtaining the user IP address */function getIp () {$ onlineip = ""; if (getenv ('http _ CLIENT_IP ') & strcasecmp (getenv ('http _ CLIENT_IP '), 'Unknown') {$ onlineip = getenv ('http _
$ _ SERVER parameter HTTP_X_FORWARDED_FOR & amp; REMOTE_ADDR and get IP address. 1. REMOTE_ADDR: IP address of the user's computer on the current page. HTTP_X_FORWARDED_FOR: view the gateway of the user's computer on the current page. HTTP_CLIENT_IP:
Php session and cookie 1. PHP COOKIE
Cookie is a mechanism for storing data in a remote browser and tracking and identifying users. PHP sends cookies in the http header. Therefore, the setcookie () function must be called before other information
Recently, xiaobian found that a netizen from Yunnan often posted some spam comments on the website. Due to the DEDECMS architecture, the system itself does not prohibit IP addresses. Every day, I see these spam comments, although there are not many,
Common functions of encoding, such as getting an IP address, sending an email, curl encapsulation, encryption, decryption, String object, and conversion to an array, will be followed by a supplement without obtaining ipfunded IP () {if (getenv
This article has compiled 13 PHP functions that are extremely practical. functions are a powerful source of PHP, but many PHP functions are not fully utilized, you must master the 13 PHP functions in this article.
1. PHP encryption and
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.