<?php
/**
* PHP Class for interfacing with the Tor Network
*/
class Tor
{
var $url;
var $userAgent;
var $timeout;
var $host;
var $vector;
var $payload;
var $returnData;
/**
* Tor Clas Constructor
*/
function Tor()
{
$this->url = null;
$this->userAgent = null;
$this->timeout = 300;
$this->host = '127.0.0.1:9050';
$this->vector = null;
}
/**
* set url
*/
function setUrl($url)
{
$this->url = $url;
}
/**
* read url
*/
function readUrl()
{
return $this->url;
}
/**
* set useragent
*/
function setUserAgent()
{
//list of browsers
$agentBrowser = array(
'Firefox',
'Safari',
'Opera',
'Flock',
'Internet Explorer',
'Seamonkey',
'Konqueror',
'GoogleBot'
);
//list of operating systems
$agentOS = array(
'Windows 3.1',
'Windows 95',
'Windows 98',
'Windows 2000',
'Windows NT',
'Windows XP',
'Windows Vista',
'Redhat Linux',
'Ubuntu',
'Fedora',
'AmigaOS',
'OS 10.5'
);
//randomly generate UserAgent
$this->userAgent = $agentBrowser[rand(0,7)].'/'.rand(1,8).'.'.rand(0,9).' (' .$agentOS[rand(0,11)].' '.rand(1,7).'.'.rand(0,9).'; en-US;)';
}
/**
* read useragent
*/
function readUserAgent()
{
return $this->userAgent;
}
/**
* set timeout
*/
function setTimeout($timeout)
{
$this->timeout = $timeout;
}
/**
* read timeout
*/
function readTimeout()
{
return $this->timeout;
}
/**
* set host
*/
function setHost($ip, $port)
{
$this->host = $ip . ":" . $port;
}
/**
* read host
*/
function readHost()
{
return $this->host;
}
/**
* set vector
*/
function setVector($vector)
{
$this->vector = $vector;
}
/**
* read vector
*/
function readVector()
{
return $this->vector;
}
/**
* launch payload
*/
function launchPayload()
{
//set randomized parameters
$this->setUserAgent();
//concatinate url
$this->payload = $this->url . $this->vector;
//run curl action against url
$action = curl_init();
curl_setopt($action, CURLOPT_PROXY, $this->host);
curl_setopt($action, CURLOPT_URL, $this->payload);
curl_setopt($action, CURLOPT_HEADER, 1);
curl_setopt($action, CURLOPT_USERAGENT, $this->userAgent);
curl_setopt($action, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($action, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($action, CURLOPT_TIMEOUT, $this->timeout);
$this->returnData = curl_exec($action);
curl_close($action);
}
function viewReturn()
{
return $this->returnData;
}
}
?>
Refactorings
No refactoring yet !
Joe Grossberg
June 29, 2008, June 29, 2008 00:33, permalink
Not a refactoring, but a few comments:
* Most of your comments are unnecessary. For example, it is obvious, through your good method name, what setUrl does.
* Second, it's traditional to name getters and setters with the names getFoo and setFoo, not readFoo and setFoo. This convention shouldn't be broken without good reason.
* Third, it appears that your use of getter and setter methods is unnecessary. None of the instance variables is private or protected, and none of the getters or setters (other than setHost) does anything other than retrieve or set the variable. I would ditch them.
* Lastly, I would move all the curl_setopt calls into another method, maybe something called setCurlDefaults
Ishkur
June 29, 2008, June 29, 2008 02:03, permalink
Well, what I was going for was being able to set parameters and being able to call them back out later. But thanks, I wasn't aware of that naming convention clash i was doing. I did plan however, on setting some of these methods to be private because a few of them aren't really meant to be set by hand.
EDIT: I took Joe's advice and redid my code accordingly. I fixed my naming conventions as well as condensed all of my 'get''s into a single method returning an array.
I also moved all of the cURL into its own method, and I've updated the status of most of the methods and set them to private.
I have not however, had a chance to test it; though it should work just as before.
I think that it a little better, but im sure more can be done.
<?php
/**
* PHP5 class for interfacing with the Tor network
* by Josh Sandlin <josh@thenullbyte.org>
*
* Licensed: MIT/X11
*
* NOTE: The proxy host is configurable by the user,
* so therefore one i not limited to only the Tor
* network. The default setting however is to run
* all data through the Tor/Privoxy network.
*
*/
class Tor
{
private $url;
private $userAgent;
private $timeout;
private $proxy;
private $vector;
private $payload;
private $returnData;
public function Tor()
{
$this->url = null;
$this->userAgent = null;
$this->timeout = 300;
$this->proxy = '127.0.0.1:9050';
$this->vector = null;
$this->payload = null;
$this->returnData = null;
}
private function setUrl($url)
{
$this->url = $url;
}
private function setUserAgent()
{
//list of browsers
$agentBrowser = array(
'Firefox',
'Safari',
'Opera',
'Flock',
'Internet Explorer',
'Seamonkey',
'Konqueror',
'GoogleBot'
);
//list of operating systems
$agentOS = array(
'Windows 3.1',
'Windows 95',
'Windows 98',
'Windows 2000',
'Windows NT',
'Windows XP',
'Windows Vista',
'Redhat Linux',
'Ubuntu',
'Fedora',
'AmigaOS',
'OS 10.5'
);
//randomly generate UserAgent
$this->userAgent = $agentBrowser[rand(0,7)].'/'.rand(1,8).'.'.rand(0,9).' (' .$agentOS[rand(0,11)].' '.rand(1,7).'.'.rand(0,9).'; en-US;)';
}
private function setTimeout($timeout)
{
$this->timeout = $timeout;
}
public function setProxy($ip, $port)
{
$this->proxy = $ip .":". $port;
}
private function setVector($vector)
{
$this->vector = $vector;
}
private function setCurl()
{
$action = curl_init();
curl_setopt($action, CURLOPT_PROXY, $this->proxy);
curl_setopt($action, CURLOPT_URL, $this->payload);
curl_setopt($action, CURLOPT_HEADER, 1);
curl_setopt($action, CURLOPT_USERAGENT, $this->userAgent);
curl_setopt($action, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($action, CURLOPT_FOLLOLOCATION, 1);
curl_setopt($action, CURLOPT_TIMEOUT, $this->timeout);
$this->returnData = curl_exec($action);
curl_close($action);
}
private function setPayload()
{
$this->payload = $this->url . $this->vector;
}
public function launch($url, $vector, $timeout = null)
{
//set parameters
$this->setUrl($url);
$this->setVector($vector);
$this->setUserAgent();
//set payload
$this->setPayload();
//if a timeout is set in the args, use it
if(isset($timeout))
{
$this->setTimeout($timeout);
}
//run cURL action against url
$this->setCurl();
}
public function getTorData()
{
return array(
'url' => $this->url,
'userAgent' => $this->userAgent,
'timeout' => $this->timeout,
'proxy' => $this->proxy,
'payload' => $this->payload,
'return' => $this->returnData
);
}
}
?>
SuDolar
June 24, 2009, June 24, 2009 18:18, permalink
Nice code, will try to implement it on my site. How's it performance-wise?
<a href="http://www.sudolar.com">Cotizacion Dolar</a> http://www.sudolar.com
bboy
September 11, 2010, September 11, 2010 21:20, permalink
How I can run this class? .. Can someone post example of usage? Thank you
mixdev
June 7, 2011, June 07, 2011 13:04, permalink
You need to add (conditional) POST support.
curl_setopt($action, CURLOPT_POST, 1);
mixdev
June 7, 2011, June 07, 2011 13:05, permalink
You need to add (conditional) POST support.
curl_setopt($action, CURLOPT_POST, 1);
TauffBekBaige
June 25, 2011, June 25, 2011 00:21, permalink
industrial fashion zippers http://luxefashion.us/replay-brand47.html madhawa atapattu fashion garments ltd vietnam 547460
Dave
August 13, 2011, August 13, 2011 18:27, permalink
thanks for the code, gave me a good starting point. Tried using this however kept getting error
"It appears you have configured your web browser to use Tor as an HTTP proxy" when using it, turns out you need to set curl into SOCK5 mode.
Here's some class usage for anyone who can't work it out
require_once("tor.php");
$tor = new Tor();
$tor->launch('http://automation.whatismyip.com/n09230945.asp', '');
$data = $tor->getTorData();
echo $data['return'];
<?php
/**
* PHP5 class for interfacing with the Tor network
* by Josh Sandlin <josh@thenullbyte.org>
*
* Licensed: MIT/X11
*
* NOTE: The proxy host is configurable by the user,
* so therefore one i not limited to only the Tor
* network. The default setting however is to run
* all data through the Tor/Privoxy network.
*
*/
class Tor
{
private $url;
private $userAgent;
private $timeout;
private $proxy;
private $vector;
private $payload;
private $returnData;
public function Tor()
{
$this->url = null;
$this->userAgent = null;
$this->timeout = 300;
$this->proxy = '127.0.0.1:9050';
$this->vector = null;
$this->payload = null;
$this->returnData = null;
}
private function setUrl($url)
{
$this->url = $url;
}
private function setUserAgent()
{
//list of browsers
$agentBrowser = array(
'Firefox',
'Safari',
'Opera',
'Flock',
'Internet Explorer',
'Seamonkey',
'Konqueror',
'GoogleBot'
);
//list of operating systems
$agentOS = array(
'Windows 3.1',
'Windows 95',
'Windows 98',
'Windows 2000',
'Windows NT',
'Windows XP',
'Windows Vista',
'Redhat Linux',
'Ubuntu',
'Fedora',
'AmigaOS',
'OS 10.5'
);
//randomly generate UserAgent
$this->userAgent = $agentBrowser[rand(0,7)].'/'.rand(1,8).'.'.rand(0,9).' (' .$agentOS[rand(0,11)].' '.rand(1,7).'.'.rand(0,9).'; en-US;)';
}
private function setTimeout($timeout)
{
$this->timeout = $timeout;
}
public function setProxy($ip, $port)
{
$this->proxy = $ip .":". $port;
}
private function setVector($vector)
{
$this->vector = $vector;
}
private function setCurl()
{
$action = curl_init();
curl_setopt($action, CURLOPT_PROXY, $this->proxy);
curl_setopt($action, CURLOPT_URL, $this->payload);
curl_setopt($action, CURLOPT_HEADER, 1);
curl_setopt($action, CURLOPT_USERAGENT, $this->userAgent);
curl_setopt($action, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($action, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($action, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($action, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
$this->returnData = curl_exec($action);
curl_close($action);
}
private function setPayload()
{
$this->payload = $this->url . $this->vector;
}
public function launch($url, $vector, $timeout = null)
{
//set parameters
$this->setUrl($url);
$this->setVector($vector);
$this->setUserAgent();
//set payload
$this->setPayload();
//if a timeout is set in the args, use it
if(isset($timeout))
{
$this->setTimeout($timeout);
}
//run cURL action against url
$this->setCurl();
}
public function getTorData()
{
return array(
'url' => $this->url,
'userAgent' => $this->userAgent,
'timeout' => $this->timeout,
'proxy' => $this->proxy,
'payload' => $this->payload,
'return' => $this->returnData
);
}
}
?>
cesinscrert
September 18, 2011, September 18, 2011 04:33, permalink
ocean city movie theater http://movieszone.eu/ the simpsons movie review 817371
esseptise
October 12, 2011, October 12, 2011 05:13, permalink
aarp national mail order pharmacy http://cheaplegalmedications.com/products/lithium-carbonate.htm applied pharmacy services list
LP
November 19, 2011, November 19, 2011 22:19, permalink
version and last modified date is a must! Found several copies of this online, but didnt know if they are the same or some updated version.
LP
November 19, 2011, November 19, 2011 22:19, permalink
version and last modified date is a must! Found several copies of this online, but didnt know if they are the same or some updated version.
Alexander
December 3, 2011, December 03, 2011 06:07, permalink
I was missing some POST functionality, and also the possibility to use --newnym. (I was writing a script to cheat on a internet poll)
<?php
/**
* PHP5 class for interfacing with the Tor network
* by Josh Sandlin <josh@thenullbyte.org>
* refactored by Alexander Kuzmin <alex_123461@hotmail.com>
*
* Licensed: MIT/X11
*
* 2011-12-03
*/
class Tor {
private $url;
private $userAgent;
private $timeout;
private $proxy;
private $vector;
private $payload;
private $returnData;
private $post;
private $postString;
private $postCount;
private $ip;
private $controlPort;
private $authCode;
public function __construct() {
$this->ip = '127.0.0.1';
$this->controlPort = '9051';
$this->authCode = '';
$this->post = false;
$this->url = null;
$this->userAgent = null;
$this->timeout = 300;
$this->proxy = '127.0.0.1:9050';
$this->vector = null;
$this->payload = null;
$this->returnData = null;
}
public function newIdentity() {
$fp = fsockopen($this->ip, $this->controlPort, $errno, $errstr, 30);
if (!$fp) throw new Exception('can\'t connect to control port');
fputs($fp, "AUTHENTICATE " . $this->authCode . "\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') throw new Exception('Authentication failed');
//send the request to for new identity
fputs($fp, "signal NEWNYM\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') throw new Exception('signal failed');
fclose($fp);
}
private function setUrl($url) {
$this->url = $url;
}
private function setUserAgent() {
//list of browsers
$agentBrowser = array(
'Firefox',
'Safari',
'Opera',
'Internet Explorer',
'Seamonkey',
);
//list of operating systems
$agentOS = array(
'Windows XP',
'Windows Vista',
'Windows 7'
);
//randomly generate UserAgent
$this->userAgent = $agentBrowser[rand(0,count($agentBrowser)-1)].'/'.rand(1,8).'.'.rand(0,9).' (' .$agentOS[rand(0,count($agentOS)-1)].' '.rand(1,7).'.'.rand(0,9).'; en-US;)';
}
private function setTimeout($timeout) {
$this->timeout = $timeout;
}
public function setProxy($ip, $port) {
$this->proxy = $ip .":". $port;
}
public function setPost($postData) {
$this->post = true;
//url-ify the data for the POST
$fields_string = '';
foreach($postData as $key=>$value) {
$fields_string .= $key.'='.$value.'&';
}
$fields_string = rtrim($fields_string,'&');
$this->postString = $fields_string;
$this->postCount = count($postData);
}
public function clearPost() {
$this->post = false;
$this->postString = null;
$this->postCount = null;
}
private function setVector($vector) {
$this->vector = $vector;
}
private function setCurl() {
$action = curl_init();
curl_setopt($action, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($action, CURLOPT_PROXY, $this->proxy);
curl_setopt($action, CURLOPT_URL, $this->payload);
curl_setopt($action, CURLOPT_HEADER, 1);
curl_setopt($action, CURLOPT_USERAGENT, $this->userAgent);
curl_setopt($action, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($action, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($action, CURLOPT_TIMEOUT, $this->timeout);
if($this->post) {
curl_setopt($action, CURLOPT_POST, $this->postCount);
curl_setopt($action, CURLOPT_POSTFIELDS, $this->postString);
}
$this->returnData = curl_exec($action);
curl_close($action);
}
private function setPayload() {
$this->payload = $this->url . $this->vector;
}
public function launch($url, $vector, $timeout = null) {
//set parameters
$this->setUrl($url);
$this->setVector($vector);
$this->setUserAgent();
//set payload
$this->setPayload();
//if a timeout is set in the args, use it
if(isset($timeout)) {
$this->setTimeout($timeout);
}
//run cURL action against url
$this->setCurl();
}
public function getTorData() {
return array(
'url' => $this->url,
'postString' => $this->postString,
'userAgent' => $this->userAgent,
'timeout' => $this->timeout,
'proxy' => $this->proxy,
'payload' => $this->payload,
'return' => $this->returnData
);
}
}
?>
Alexander
December 3, 2011, December 03, 2011 06:07, permalink
I was missing some POST functionality, and also the possibility to use --newnym. (I was writing a script to cheat on a internet poll)
<?php
/**
* PHP5 class for interfacing with the Tor network
* by Josh Sandlin <josh@thenullbyte.org>
* refactored by Alexander Kuzmin <alex_123461@hotmail.com>
*
* Licensed: MIT/X11
*
* 2011-12-03
*/
class Tor {
private $url;
private $userAgent;
private $timeout;
private $proxy;
private $vector;
private $payload;
private $returnData;
private $post;
private $postString;
private $postCount;
private $ip;
private $controlPort;
private $authCode;
public function __construct() {
$this->ip = '127.0.0.1';
$this->controlPort = '9051';
$this->authCode = '';
$this->post = false;
$this->url = null;
$this->userAgent = null;
$this->timeout = 300;
$this->proxy = '127.0.0.1:9050';
$this->vector = null;
$this->payload = null;
$this->returnData = null;
}
public function newIdentity() {
$fp = fsockopen($this->ip, $this->controlPort, $errno, $errstr, 30);
if (!$fp) throw new Exception('can\'t connect to control port');
fputs($fp, "AUTHENTICATE " . $this->authCode . "\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') throw new Exception('Authentication failed');
//send the request to for new identity
fputs($fp, "signal NEWNYM\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') throw new Exception('signal failed');
fclose($fp);
}
private function setUrl($url) {
$this->url = $url;
}
private function setUserAgent() {
//list of browsers
$agentBrowser = array(
'Firefox',
'Safari',
'Opera',
'Internet Explorer',
'Seamonkey',
);
//list of operating systems
$agentOS = array(
'Windows XP',
'Windows Vista',
'Windows 7'
);
//randomly generate UserAgent
$this->userAgent = $agentBrowser[rand(0,count($agentBrowser)-1)].'/'.rand(1,8).'.'.rand(0,9).' (' .$agentOS[rand(0,count($agentOS)-1)].' '.rand(1,7).'.'.rand(0,9).'; en-US;)';
}
private function setTimeout($timeout) {
$this->timeout = $timeout;
}
public function setProxy($ip, $port) {
$this->proxy = $ip .":". $port;
}
public function setPost($postData) {
$this->post = true;
//url-ify the data for the POST
$fields_string = '';
foreach($postData as $key=>$value) {
$fields_string .= $key.'='.$value.'&';
}
$fields_string = rtrim($fields_string,'&');
$this->postString = $fields_string;
$this->postCount = count($postData);
}
public function clearPost() {
$this->post = false;
$this->postString = null;
$this->postCount = null;
}
private function setVector($vector) {
$this->vector = $vector;
}
private function setCurl() {
$action = curl_init();
curl_setopt($action, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($action, CURLOPT_PROXY, $this->proxy);
curl_setopt($action, CURLOPT_URL, $this->payload);
curl_setopt($action, CURLOPT_HEADER, 1);
curl_setopt($action, CURLOPT_USERAGENT, $this->userAgent);
curl_setopt($action, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($action, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($action, CURLOPT_TIMEOUT, $this->timeout);
if($this->post) {
curl_setopt($action, CURLOPT_POST, $this->postCount);
curl_setopt($action, CURLOPT_POSTFIELDS, $this->postString);
}
$this->returnData = curl_exec($action);
curl_close($action);
}
private function setPayload() {
$this->payload = $this->url . $this->vector;
}
public function launch($url, $vector, $timeout = null) {
//set parameters
$this->setUrl($url);
$this->setVector($vector);
$this->setUserAgent();
//set payload
$this->setPayload();
//if a timeout is set in the args, use it
if(isset($timeout)) {
$this->setTimeout($timeout);
}
//run cURL action against url
$this->setCurl();
}
public function getTorData() {
return array(
'url' => $this->url,
'postString' => $this->postString,
'userAgent' => $this->userAgent,
'timeout' => $this->timeout,
'proxy' => $this->proxy,
'payload' => $this->payload,
'return' => $this->returnData
);
}
}
?>
Alexander
December 3, 2011, December 03, 2011 06:07, permalink
I was missing some POST functionality, and also the possibility to use --newnym. (I was writing a script to cheat on a internet poll)
<?php
/**
* PHP5 class for interfacing with the Tor network
* by Josh Sandlin <josh@thenullbyte.org>
* refactored by Alexander Kuzmin <alex_123461@hotmail.com>
*
* Licensed: MIT/X11
*
* 2011-12-03
*/
class Tor {
private $url;
private $userAgent;
private $timeout;
private $proxy;
private $vector;
private $payload;
private $returnData;
private $post;
private $postString;
private $postCount;
private $ip;
private $controlPort;
private $authCode;
public function __construct() {
$this->ip = '127.0.0.1';
$this->controlPort = '9051';
$this->authCode = '';
$this->post = false;
$this->url = null;
$this->userAgent = null;
$this->timeout = 300;
$this->proxy = '127.0.0.1:9050';
$this->vector = null;
$this->payload = null;
$this->returnData = null;
}
public function newIdentity() {
$fp = fsockopen($this->ip, $this->controlPort, $errno, $errstr, 30);
if (!$fp) throw new Exception('can\'t connect to control port');
fputs($fp, "AUTHENTICATE " . $this->authCode . "\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') throw new Exception('Authentication failed');
//send the request to for new identity
fputs($fp, "signal NEWNYM\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') throw new Exception('signal failed');
fclose($fp);
}
private function setUrl($url) {
$this->url = $url;
}
private function setUserAgent() {
//list of browsers
$agentBrowser = array(
'Firefox',
'Safari',
'Opera',
'Internet Explorer',
'Seamonkey',
);
//list of operating systems
$agentOS = array(
'Windows XP',
'Windows Vista',
'Windows 7'
);
//randomly generate UserAgent
$this->userAgent = $agentBrowser[rand(0,count($agentBrowser)-1)].'/'.rand(1,8).'.'.rand(0,9).' (' .$agentOS[rand(0,count($agentOS)-1)].' '.rand(1,7).'.'.rand(0,9).'; en-US;)';
}
private function setTimeout($timeout) {
$this->timeout = $timeout;
}
public function setProxy($ip, $port) {
$this->proxy = $ip .":". $port;
}
public function setPost($postData) {
$this->post = true;
//url-ify the data for the POST
$fields_string = '';
foreach($postData as $key=>$value) {
$fields_string .= $key.'='.$value.'&';
}
$fields_string = rtrim($fields_string,'&');
$this->postString = $fields_string;
$this->postCount = count($postData);
}
public function clearPost() {
$this->post = false;
$this->postString = null;
$this->postCount = null;
}
private function setVector($vector) {
$this->vector = $vector;
}
private function setCurl() {
$action = curl_init();
curl_setopt($action, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($action, CURLOPT_PROXY, $this->proxy);
curl_setopt($action, CURLOPT_URL, $this->payload);
curl_setopt($action, CURLOPT_HEADER, 1);
curl_setopt($action, CURLOPT_USERAGENT, $this->userAgent);
curl_setopt($action, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($action, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($action, CURLOPT_TIMEOUT, $this->timeout);
if($this->post) {
curl_setopt($action, CURLOPT_POST, $this->postCount);
curl_setopt($action, CURLOPT_POSTFIELDS, $this->postString);
}
$this->returnData = curl_exec($action);
curl_close($action);
}
private function setPayload() {
$this->payload = $this->url . $this->vector;
}
public function launch($url, $vector, $timeout = null) {
//set parameters
$this->setUrl($url);
$this->setVector($vector);
$this->setUserAgent();
//set payload
$this->setPayload();
//if a timeout is set in the args, use it
if(isset($timeout)) {
$this->setTimeout($timeout);
}
//run cURL action against url
$this->setCurl();
}
public function getTorData() {
return array(
'url' => $this->url,
'postString' => $this->postString,
'userAgent' => $this->userAgent,
'timeout' => $this->timeout,
'proxy' => $this->proxy,
'payload' => $this->payload,
'return' => $this->returnData
);
}
}
?>
Yancy
January 5, 2012, January 05, 2012 06:59, permalink
You rlelay saved my skin with this information. Thanks!
?
Yancy
January 5, 2012, January 05, 2012 06:59, permalink
You rlelay saved my skin with this information. Thanks!
?
Yancy
January 5, 2012, January 05, 2012 06:59, permalink
You rlelay saved my skin with this information. Thanks!
?
tietryLeappy
February 2, 2012, February 02, 2012 19:53, permalink
nevada pharmacy technician certification http://legalexclusivepharmacy.com/catalog/Muscle_Relaxant/Skelaxin.htm massachusetts college of pharmacy and health sciences
I found a php function that does this, but I didnt like it. So, I recoded it as a class. I'm rather new to classes and OOP, so I'm sure there's a better way I could have gone about this. Any ideas on making my code more efficient will be appreciated.