cURL Web proxy Script Showing Weird Arrays!


This is a basic cURL web proxy script.
Why is it showing weird array pattern looking errors ?


function CURLGetURL($url){

// use CURL to make request

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url); // the url to retrieve
curl_setopt($ch, CURLOPT_HEADER, 1); // return the header along with body
curl_setopt($ch, CURLOPT_MAXREDIRS, 3); // follow this amount of redirects
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,5); // follow redirects - change or paramterize
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return output as string
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); //ignore issues with SSL certificates
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); // connection timeout in seconds
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4"); // the useragent to connect with

// get response and set array up

$urlinfo["html"] = curl_exec($ch);
$urlinfo["status"] = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$urlinfo["error"] = curl_error($ch);
$urlinfo["headers"] = curl_getinfo($ch);


// return hash table of response
return $urlinfo;

// example
$http = CURLGetURL("");


if($http["status"] == 200){

// we got a valid 200 OK response - output html
echo $http["html"];


// show error
echo "returned a " . $http["status"] . " status error";

// output error details
print_r( $http["error"] );

// output all header info
print_r( $http["headers"] );


I get this error:

returned a 403 status errorArray ( [url] => [content_type] => text/html [http_code] => 403 [header_size] => 208 [request_size] => 181 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.672 [namelookup_time] => 0.266 [connect_time] => 0.453 [pretransfer_time] => 0.453 [size_upload] => 0 [size_download] => 261 [speed_download] => 388 [speed_upload] => 0 [download_content_length] => 261 [upload_content_length] => -1 [starttransfer_time] => 0.672 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) [primary_port] => 80 [local_ip] => [local_port] => 51660 )

What does that mean?

That array is information about the error, it seems self explanatory.

403 means “Forbidden”.

Though it does not say why you are forbidden, probably doesn’t like what you are trying to do. I use quite a few 403s for bots and things that I don’t like.

that simply means you’re not authenticated. I would also guess Ebay is blocking you.

Funny Ebay does not block me when I use another php proxy script that I am also trying to add my own codes to add a new feature. So, why would they block this php script ?

Quite frankly, I’ve had enough of this web proxy script. I’m moving onto others. Do you guys know of any good stable web proxy php scripts ?
I’m going to add my link tracker code so the proxified links get click-tracked. That’s all. Tried MiniProxy and managed to add the tracker but it tracks not only the page the user is in but any links present on the page the user is at and tracking those extra links is not what I want and so I was looking into this proxy script instead which is now becoming more bothersome than the first.
Not interested in Glype. Looking into Php-Proxy now and a few others.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.