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
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 seg
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
API Home: Http://lbsyun.baidu.com/index.php?title=webapi/high-acc-ip1. Apply for Baidu account, create application, get key (AK)Http://lbsyun.baidu.com/apiconsole/keyEnable the service :, can be based on their own needs to hook-and-choose, here First all selected.Request Check method : IP Whitelist Check/sn
We know that the tcp ip protocol stack includes many protocols. So let's take a look at the functions and functions of the protocols here. Now let's make an inventory check to help you summarize it and hope it will help you.
1. bsd tcp ip protocol stack
BSD stack is the starting point of other commercial stacks in history. Most professional TCP/
IntroductionIn this article we'll create a small utility using C # that tells us whether we have API server is up or down.PurposeOur purpose are to check the API server so and we can make a request for our resources. It is recommended this before making any request to the server (API server in our case), we should ensu
; }/** * IP location * @param string $IP * @return Array * @throws Exception */Public Function Locationbyip ($IP) {//Check for fit Method IP if (!filTer_var ($ip, filter_validate_ip)) {throw new Exception ('
} IP_ADAPTER_INDEX_MAP, * PIP_ADAPTER_INDEX_MAP;
Extract IP informationThe extracted network interface information is the same.
Set Local NetworkThe setting process is similar to the extraction process.
Other API functionsThese functions can view or set the information of network datagram. For example, the getipstatistics and geticmpstatistics functions can view the traffic of the current
button. You can click the button to change the text of the button. Simply add the setdlgitemtext function to the Message response function, when a button is clicked, the text of the button is changed.
Int ret; updatedata (true); setdlgitemtext (idok, "pressed"); char * SZ = m_nihao.getbuffer (m_nihao.getlength (); ret = MessageBox (SZ, "SS ", mb_ OK); If (ret = idok) {setdlgitemtext (idok, "OK ");}
Check box control:
The
PHP snippet (send SMS, find address based on IP, display source code of Web page, check server for HTTPS, display faceboo** number, detect main color of image, get memory usage information)
1. Send SMS Call Textmagic API. Include the Textmagic PHP librequire (' textmagic-sms-api-php/textmagicapi.php ');//Set the user
PhpIP retrieval City API (pure IP database)
/**
* Obtain the city name pure IP database based on the IP address
* Edit: bbs.it-home.org
*/
Function convertip ($ ip ){
// IP
PHP snippet (send SMS, find address based on IP, display source code of Web page, check server for HTTPS, display faceboo** number, detect main color of image, get memory usage information)
1. Send SMS Call Textmagic API. Include the Textmagic PHP librequire (' textmagic-sms-api-php/textmagicapi.php ');//Set the user
.
/***************************************** **********************************Function: ip_sum_calcDescription: Calculate the 16 bit IP sum.**************************************** ************************************/Typedef unsigned short 2010;Typedef unsigned long u32;
Service.eu-central-1.maxcompute.aliyun-inc.com/api{2010word16;U32 sum = 0;2010i;// Make 16 bit words out of every two adjacent 8 bit wor
The main added 1 Selectinterfaces records, the essence is that the database is the join this table. The Perl code is as follows:#!/usr/bin/perl UseStrict; Usewarnings; UseJSON::RPC::Client; UseData::dumper; UseJSON; UseUTF8; UseParallel::Forkmanager;my $pm= Parallel::forkmanager->new ( -); #define the number of open processes$| =1;Binmode(STDIN,': Encoding (UTF8)' );Binmode(STDOUT,': Encoding (UTF8)' ); #Three rowsBinmode(STDERR,': Encoding (UTF8)' ); #for normal output Chinese # Authenticate yo
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.