Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$data = file($file); and $_REQUEST["url"] = 403 error

Status
Not open for further replies.

Steph64

Programmer
Sep 27, 2005
2
US
Hi Folks

I'm having a very strange issue with a script that can be found at:


In a nutshell, this script merely returns a Google Page Rank for any given domain.

Warning: file( failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /public_html/pr.php on line 109
PageRank:
provided by Google Community.com

Line 109 is:
$data = file($file);

I've tested this on other servers and it is not a problem. I was told that this problem could be caused by not having allow_url_fopen enabled. In my case, it is enabled.

I was also told that the problem could be caused by upstream proxies, but my host assures me there are none present.

I'm using PHP 4.4.0 and from what I can see, my settings are the same as other servers where this script works.

Does anyone have any ideas on what could be causing this problem.

Thanks!
 
You're right -- it's not a allow_url_fopen problem. If it were, you wouldn't get a "HTTP/1.0 403 Forbidden" error but rather a "URL fopen not allowed" error.

When I click on the link in the quoted text of your output (the [ignore]"[/ignore] part), my browser also returns an error report from Google. The guts of the report are:

Forbidden
Your client does not have permission to get URL [ignore]/search?ch=6-2147468586&client=navclient-auto&features=Rank&q=info:[/ignore] from this server. (Client IP address: <my ip removed>)

Please see Google's Terms of Service posted at

This sounds like Google limits which computers can fetch this data. I'd talk to Google about it.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I read this as a rejection by the Google server. Actually go ahead and just read what the URL says (click your own URL):
Google said:
Forbidden
Your client does not have permission to get URL /search?client=navclient-auto&ch=6-2147468586&features=Rank&q=info: from this server. (Client IP address: xxx.xxx.xxx.xxx)
Please see Google's Terms of Service posted at
If you believe that you have received this response in error, please send email to forbidden@google.com. Before sending this email, however, please make sure to take a look at our Terms of Service (
 
Actually, you can't click the link. It is not intended to work that way. If you click the generated link in the error code, you are executing a client query with an agent that is discovered by Google which is why you get the error report page after that.

The script itself runs on your server. When it works properly, it simply show your google page rank.

Please see the script as identified in the original post.

To test it, save the file as "pagerank.php" and load it on your server. To run it, call it as follows:

You can execute this to determine any site's pagerank by calling the file and using any url after ?url=

Steph
 
The output you show in your original post, namely the HTTP error 403 indicates just what sleipnir214 and I am saying. You are getting a 403 access denied error. This indicates that Google does not allow you to access the URL the page with the GET request you issued.

The reasons for that we can't really determine from the script. It could be that your IP is blocked, it could also be that the commented line with the content type in the script is to blame.





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top