Skip to main content
All CollectionsHow to Use GuidesScript
How to use HTTP Proxies in PHP Code using Limeproxies?
How to use HTTP Proxies in PHP Code using Limeproxies?
Steve M avatar
Written by Steve M
Updated over 5 years ago

Before using our proxies, ensure that your server IP address is authorized via the proxy panel.

Sample code for using our proxies in PHP Code:

<?php

$url = 'http://limeproxies.com/anonymity.php/';
$proxy = '1.1.1.1:1212';  // <-- set your proxy and port number
$content = requestUrl($url, $proxy);
print $content;

function requestUrl($url, $proxy = NULL) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
if ($proxy != NULL) {
curl_setopt($curl, CURLOPT_PROXY, $proxy);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
$contents = curl_exec($curl);
curl_close($curl);
return $contents;
}

?>

Did this answer your question?