开发者

PHP Port Problem

开发者 https://www.devze.com 2023-02-15 12:59 出处:网络
I\'m using a PHP script to detect of a referral URL is a proxy. This开发者_JAVA技巧 is a very simplified version but it works great.

I'm using a PHP script to detect of a referral URL is a proxy. This开发者_JAVA技巧 is a very simplified version but it works great.

The problem is that I'm trying to use the same script on my other web server but for reasons am not copying over the script. What I'm doing instead is using a get_file_contents.

My problem is that when I use get_file_contents it detects it as a proxy. Is there anyway around this, possibly by changing the port?

<?php $stop = file_get_contents("http://mysite.com/file.php"); echo $stop; ?>

Any help would be great, Thanks!


file_get_contents with a remote URL is very different from a local URL -- you are actually running the script on mysite.com and simply getting the output of that script on your local server. This actually sends another HTTP request to mysite.com, so the referrer for that request is different from the referrer for your original request.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号