Use CURL to forge the source URL and IP address. Many votes have to verify the origin site and IP address, but CURL can be forged into any URL and IP address to bypass some simple verification. The following is a simple example. Many votes in the program are verified on the origin site and IP address, but the use of CURL can be forged into any URL and IP address, to bypass some simple verification, the following is a simple example.
Before running the program, make sure that extension = php_curl.dll is not commented out in php. ini.
Test. php
Test. php sends a request to test_2.php.
IP: " . getClientIp() . ""; echo "
referer: " . $_SERVER["HTTP_REFERER"]; ?>
The program running result is as follows:
HTTP/1.1 200 OK Date: Tue, 01 Nov 2011 12:20:06 GMT Server: Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 X-Powered-By: PHP/5.2.9 Content-Length: 53 Content-Type: text/html IP: 8.8.8.8referer: http://www.bkjia.com/
As you can see, the IP address and address can be changed at will. you can use this for many vote functions that do not have a complete voting mechanism.
By the way, it's about the real IP address.
Generally, the environment variable $ _ SERVER ['remote _ ADDR '] is used to obtain the user IP address. However, this variable only records the last host IP address. Therefore, when the user's browser sets a Proxy, the real IP address cannot be obtained.
In this case, you can use another environment variable $ _ SERVER ['http _ X_FORWARDED_FOR '] to record the host IP address, which is generated only when the user passes through the Proxy, therefore, you can write as follows to obtain the real IP address of the user.
Bytes. Program...