I'm trying to open the following URL with fopen:
Ceramic Hob&bq=[price(float GBP)>=159.00 GBP]&max-results=3&orderby=[x=price(float GBP): max(x)]
(copy and paste the entire line, it will work in a browser).
However, trying:
Results in the following warning:
PHP Warning: fopen( Ceramic Hob&bq=[price(float GBP)>=159.00 GBP]&max-results=3&orderby=[x=price(float GBP): max(x)]): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
Thinking the special characters were the cause of the problem, I tried:
However, I receive the same error (although the special characters are now encoded).
The URL works fine in a browser, and I can open other external URL's with fopen(), but I cannot seem to get this particular URL (or any variation of it) to work.
I have checked allow_url_fopen is enabled and the user_agent value is set to mimic a known web browser in php.ini. I doubt either to be the problem though as mentioned earlier I can open other external URL's with fopen().
Ceramic Hob&bq=[price(float GBP)>=159.00 GBP]&max-results=3&orderby=[x=price(float GBP): max(x)]
(copy and paste the entire line, it will work in a browser).
However, trying:
Code:
<?php
$url = "[URL unfurl="true"]http://www.google.com/base/feeds/snippets/-/products?q=Electric[/URL] Ceramic Hob&bq=[price(float GBP)>=159.00 GBP]&max-results=3&orderby=[x=price(float GBP): max(x)]";
fopen($url,'rb');
?>
Results in the following warning:
PHP Warning: fopen( Ceramic Hob&bq=[price(float GBP)>=159.00 GBP]&max-results=3&orderby=[x=price(float GBP): max(x)]): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
Thinking the special characters were the cause of the problem, I tried:
Code:
<?php
$url = "[URL unfurl="true"]http://www.google.com/base/feeds/snippets/-/products"[/URL] . urlencode("?q=Electric Ceramic Hob&bq=[price(float GBP)>=159.00 GBP]&max-results=3&orderby=[x=price(float GBP): max(x)]");
?>
fopen($url,'rb');
?>
However, I receive the same error (although the special characters are now encoded).
The URL works fine in a browser, and I can open other external URL's with fopen(), but I cannot seem to get this particular URL (or any variation of it) to work.
I have checked allow_url_fopen is enabled and the user_agent value is set to mimic a known web browser in php.ini. I doubt either to be the problem though as mentioned earlier I can open other external URL's with fopen().