php script to change ip address

forthisbh

Newbie
Joined
Aug 1, 2013
Messages
31
Reaction score
0
I have a php script

$config['proxy'] = 'website with numerical port number';
$config['proxy_username'] = '';
$config['proxy_password'] = '';


what is a service I can use that has a proxyaddress : port, username,password
where I can run this php script from the same ip address (localhost for example) and the recipient thinks I am using a different ip address
 
try something like this:

PHP:
<?php

$proxy = "xx.xx.xx.xx:xx";
$proxy = explode(':', $proxy);
$url = "http://www.google.com";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy[0]);
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy[1]);
curl_setopt($ch, CURLOPT_HEADER, 1);
$exec = curl_exec($ch);

?>
 
or this for proxies with user and password

Code:
<?PHP
function curlbrowse($url,$proxy_ip,$proxy_port,$loginpassw)
{
    $loginpassw = 'username:password';
    $proxy_ip = 'proxy ip';
    $proxy_port = 'proxy port';
    $url = 'http://www.domain.com';

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
    curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');
    curl_setopt($ch, CURLOPT_PROXY, $proxy_ip);
    curl_setopt($ch, CURLOPT_PROXYUSERPWD, $loginpassw);
    $data = curl_exec($ch);
    curl_close($ch);

    return $data;
}

?>
 
Back
Top