rsoler
Aug 10th 2007, 4:25 am
I use a php proxy that works fine but when i try to use it in this url fails if you take out the proxy call it works here is the link
this one works fine
http://yoursite.com/xml_proxy.php?url=http://rss.cnn.com/rss/cnn_topstories.rss
this other does not work
http://mysite.com/Proxy1.php?url=http://flickr.com/services/rest/?application=coopelrecreo&method=flickr.photos.search&tags=geotagged&tag_mode=all&per_page=5&page=1&extras=geo&bbox=-180%2C-90%2C180%2C90&api_key=82831e02041ba02034cba9a3fb362e8b
if you take out the proxy call works fine
here is the proxy code what can be the error
thanks in advance
r.soler
Code: ( php )
<?php
$post_data = $HTTP_RAW_POST_DATA;
$header[] = "Content-type: application/atom+xml,application/xml,text/xml,text/plain";
$header[] = "Content-length: ".strlen($post_data);
$ch = curl_init( $_GET['url'] );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
if ( strlen($post_data)>0 ){
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}
$response = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
print $response;
}
this one works fine
http://yoursite.com/xml_proxy.php?url=http://rss.cnn.com/rss/cnn_topstories.rss
this other does not work
http://mysite.com/Proxy1.php?url=http://flickr.com/services/rest/?application=coopelrecreo&method=flickr.photos.search&tags=geotagged&tag_mode=all&per_page=5&page=1&extras=geo&bbox=-180%2C-90%2C180%2C90&api_key=82831e02041ba02034cba9a3fb362e8b
if you take out the proxy call works fine
here is the proxy code what can be the error
thanks in advance
r.soler
Code: ( php )
<?php
$post_data = $HTTP_RAW_POST_DATA;
$header[] = "Content-type: application/atom+xml,application/xml,text/xml,text/plain";
$header[] = "Content-length: ".strlen($post_data);
$ch = curl_init( $_GET['url'] );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
if ( strlen($post_data)>0 ){
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}
$response = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
print $response;
}