Implement the CULR proxy IP address.

Source: Internet
Author: User
The implementation of the CULR proxy IP address! [Urgent] print $ _ SERVER ['remote _ ADDR ']; get the real IP address $ _ SERVER ['http _ X_FORWARDED_FOR']; get the proxy IP address & nbsp; returns the webpage content through proxy access. & lt ;? Php $ CULR proxy IP implementation, waiting for the gods! [Urgent]
Print $ _ SERVER ['remote _ ADDR ']; obtain the real IP address
$ _ SERVER ['http _ X_FORWARDED_FOR ']; obtains the proxy IP address.

 

Implement proxy access to the Web site to return webpage content

$ Ip = rand (1,255). '.'. rand (1,255). '.'. rand (1,255). '. rand (1,255 );
$ HeaderArr [] = 'x-FORWARDED-FOR '.': '. $ ip;
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, "http://ip138.com ");
Curl_setopt ($ ch, CURLOPT_HTTPHEADER, $ headerArr );
$ Re = curl_exec ($ ch );
Var_dump ($ re );


This is the code I wrote and is useless.
$ _ SERVER ['remote _ ADDR ']; print out my real IP address
$ _ SERVER ['http _ X_FORWARDED_FOR ']; the printed IP address is my virtual IP address.

The php curl ip proxy can display the IP address returned by the program as the proxy IP address: More

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.