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 php function used to check whether
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 example:
Ip.txt
192.168
211.67.188
211.67.191.25
The Code is as follows:
The
Interceptor Implementation IP blacklist prefaceRecently has been engaged in hexo+githubpage build personal blog, so not how to carry out springboot study. So today we have made a modification to the last "? Seconds anti-refresh". The last time the feature was implemented with annotations and interceptors ( @Aspect ). However, if the demand is a global interceptor for most of the URLs are intercepted, it is
host [mail3.corpease.net] blocked using barracuda reputation;
Http://bbl.barracudacentral.com/q.cgi? IP = 219.137.86.1092. as shown above, your office Internet site Internet IP Address: 219.137.86.109 was added to the barracuda blacklist, if you are anxious to send mail, you can open the http://mail.corpease.net or http://mail.c2.corpease.net into web mail to
IP blacklist implementation method is to put the IP to be filtered in a TXT file or database, and then when we access to obtain our IP address and then to traverse the comparison can be achieved.
The school's news system requires some news to only open the campus IP browsing
This is a detection of IP is illegal PHP function, to adapt to the whitelist, blacklist function development, the main scenario applied: API source restrictions, access restrictions and so on.
Copy Code code as follows:
/**
* Secure IP detection, support IP segment detection
* @param string $
The school's news system requires some news only to open the campus IP browsing, so rewrite a code to implement this function, the result is, as long as the IP access allowed to be included in the Ip.txt this file, while supporting the C-class IP, for example:
Ip.txt192.168211.67.188211.67.191.25The code is as follows:
Copy Code code as follows:
The school's news system requires some news to only open the campus IP browsing, and then rewrite a code to implement this function, the result is that, as long as the allowed IP access to ip.txt This file can be included, while supporting Class C IP, for example:
Ip.txt192.168211.67.188211.67.191.25The code is as follows:
Copy the Code code as follows:/**
This article mainly introduces php code examples for judging ip blacklist programs. For more information, see
This article mainly introduces php code examples for judging ip blacklist programs. For more information, see
And supports Class c ip addresses, for example:
The school's news system requires some news only to open the campus IP browsing, so rewrite a code to implement this function, the result is, as long as the IP access allowed to be included in the Ip.txt this file, while supporting the C-class IP, for example:
Ip.txt192.168211.67.188211.67.191.25The code is as follows:
The code is as follows
Cop
This article mainly introduces the PHP Judgment IP blacklist program code example, the need for friends can refer to the following
The school's news system requires some news to only open the campus IP browsing, and then rewrite a code to implement this function, the result is that, as long as the allowed IP access to
Php judges the ip blacklist program code instance. In this example, you can upload the file and support class c ip addresses. for example:
Ip.txt192.168211.67.188211.67.191.25The code is as follows:
The code is as follows:
/** IP address blacklist and whitelist* The
Recently in a project, you need to do an automatic blacklist settings, that is, a day to repeat the error more than a certain number of mobile phone number, and IP to blacklist inside, the next time the request to determine whether in the blacklist.This is the way to get the IP address1 Private stringGetIP ()2
This article mainly introduces PHP to determine the IP blacklist program code example, the need for friends can refer to the following The school's news system requires some news only to open the campus IP browsing, so rewrite a code to implement this function, the result is, as long as the IP access allowed to be in
the letter. A computer sends a message like a postman, it must know the only "home address" to not send the letter to the wrong family. But our address is expressed in words, and the address of the computer is expressed in decimal digits.
How do I check the IP address?
There are a number of ways to view your computer's IP address. Below we briefly introduce 2
PHP code snippets (sending text messages, searching IP addresses, displaying the source code of the web page, checking whether the server uses HTTPS, displaying the number of Faceboo ** filaments, checking the main color of the image, and obtaining memory usage information)) 1. call TextMagicAPI to send text messages. // IncludetheTextM PHP code snippet (send text messages, search for addresses based on IP
/** * Get local IP address * @author YOLANDA * @return */public static string Getlocalipaddress () {String ipAddress = ""; try {Enumerat ion/* here to add a little explanation, because at the beginning of 21, HttpClient was abandoned, Google recommended the use of Urlconnect, where the Ipv4 is also abandoned, in order to be compatible with later versions, I httpclient some of the source code directly to the project to use, so here appears the Ipv4
Description: Everyone at ordinary times to Linux server security is mainly to the system user inspection, landing server IP check, as well as firewall status check!
1. You need to store the correct system username in the/root/liu_shell/local_user.txt file, and then compare!2. To the landing IP to determine whether to
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.