[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
Summary and collation of super-practical PHP functions2014-12-06 Category: Web development, programming development, home essence of the No comment Source: Moonlight Light Blogshare to: more 81, PHP encryption and decryptionPHP encryption and
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.
PrefaceI wanted to see the question and go to bed directly. I saw that this question was just a question of Beihang's computer. At that time, there were very few people who made it. So I couldn't help but feel excited, I have to talk to one of my
Php judges ip blacklist program code instances
This article mainly introduces php code examples for judging ip blacklist programs. For more information, see
And supports Class c ip addresses. For
Show comments locationPut the following functions in your functions. phpThe implementation principle is to use the IP query interfaces of Sina and Taobao to return the city to which the IP belongs.Minor repairs the code, removes the mount point, and
Limit the IP voting program, can not use the web search for PHP to obtain the client IP code to obtain the client IP-reproduced
the need to get a polling campaign needs to be done IP restrictions, each IP limit a certain chance of voting. I
Obtain the real IP address of a user The code is as follows:Copy code Function get_client_ip (){ If (getenv ("REMOTE_ADDR") & strcasecmp (getenv ("REMOTE_ADDR"), "unknown ")) { $ Onlineip = getenv ("REMOTE_ADDR ");Return $ onlineip;
The code segment is found when I search for related solutions on the internet. The logic of the makePregIP function of this class is a bit problematic. I have modified it and can use it. This function allows access from IP addresses in the whitelist.
And supports Class c ip addresses. For example:Ip.txt192.168211.67.188211.67.191.25The code is as follows: The code is as follows:Copy code /** IP address blacklist and whitelist* The ip address of the visitor address is in ip.txt and supports
Today, I went to the blog of qingdou of youlink and found a button on his website that is currently online. It also showed the number of people online, so I couldn't resist the curiosity and moved the mouse over, A drop-down will automatically show
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
Add the following code to the page where you want to prohibit access or submit a form.Note: Below is just an instance code that restricts IP to PHP, and if you intend to apply it to a CMS, modify it yourself.PHP/Add IP Access Restrictionsif(getenv('
This article analyses the restrictive IP voting program implemented by PHP. Share to everyone for your reference, specific as follows:
Received a polling campaign needs to do IP restrictions, each IP limit a certain amount of voting opportunities.
Function:1, get the current IP address,2, call the Sina API to get to the current city.3, convert the Chinese to pinyin and then jump.
Copy Code code as follows:
Include './pinyin.php ';
Get current IPfunction GetIP () {$onlineip = '
In this paper, several practical custom functions of PHP are summarized. Share to everyone for your reference, specific as follows:
Looking at the code recently, I found the following are some of the more useful functions.
1, take the client IP
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.