Ik heb de proxy IP’s hier (http://www.ip-adress.com/Proxy_Checker/) getest en ze zijn allemaal werkende.
Wat ik ge-echot krijg is de variable $run->IP, $run->source echot niets.
hier is mijn code:
<?php
include 'connect.php';
set_time_limit(0);
class extract_html{
public $source;
public $IP;
# Extract all html from $url
public function __construct($url){
# Random IP
$query_ip = "SELECT * FROM proxy WHERE status = '1' ORDER BY RAND() LIMIT 0,1";
$res_ip = mysql_query($query_ip) or die (mysql_error());
$row_ip = mysql_fetch_assoc ($res_ip);
# Random User agent
$query_ua = "SELECT * FROM agent ORDER BY RAND() LIMIT 0,1";
$res_ua = mysql_query($query_ua) or die (mysql_error());
$row_ua = mysql_fetch_assoc ($res_ua);
$proxy = $row_ip['ip'];
$agent = $row_ua['agent'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_USERAGENT,$agent);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$data = curl_exec($ch);
curl_close($ch);
$this->IP = $proxy;
$this->source = $data;
}
}
$run = new extract_html('http://whatismyipaddress.com/');
echo "Proxy address used: </br>" . $run->IP . "</br>";
echo "The source code: </br>" . $run->source;
?>
alvast bedankt voor uw tijd.