Hey,
I'm in the giving mood right now. But funny enough I'm not in the explaining PHP code mood....so I'll give you some scriptaculous shit but won't explain it! Luckily it's super easy.
If you haven't read Eli's CAPTCHA army post, do it now. I'm creating one of those for GMail, myspace, youtube, and metacafe. And I'm going to give each one away in this post!
NOTE: I take no responsibility for however badly you may get fucked for using these scripts. I do take responsibility, however, for how badly fucked you will be if you try to sell these or some shit like that.
Make sure you use session_start() at the top of your page!!! I used sessions to pass some information so you'll need it.
You'll need this cURL class (modified from lerch's) and signup class for each one, just put it in the top of your file or include it:
UPDATED 6/20 - (like that color bitches?!) Just changed this a bit to add the signup class.
go to next post....
I'm in the giving mood right now. But funny enough I'm not in the explaining PHP code mood....so I'll give you some scriptaculous shit but won't explain it! Luckily it's super easy.
If you haven't read Eli's CAPTCHA army post, do it now. I'm creating one of those for GMail, myspace, youtube, and metacafe. And I'm going to give each one away in this post!
NOTE: I take no responsibility for however badly you may get fucked for using these scripts. I do take responsibility, however, for how badly fucked you will be if you try to sell these or some shit like that.
Make sure you use session_start() at the top of your page!!! I used sessions to pass some information so you'll need it.
You'll need this cURL class (modified from lerch's) and signup class for each one, just put it in the top of your file or include it:
UPDATED 6/20 - (like that color bitches?!) Just changed this a bit to add the signup class.
PHP:
class Curl
{
function setup()
{
$cookieJar = 'cookies.txt';
curl_setopt($this->curl,CURLOPT_COOKIEJAR, $cookieJar);
curl_setopt($this->curl,CURLOPT_COOKIEFILE, $cookieJar);
curl_setopt($this->curl,CURLOPT_AUTOREFERER, true);
curl_setopt($this->curl,CURLOPT_FOLLOWLOCATION, true);
curl_setopt($this->curl,CURLOPT_RETURNTRANSFER, true);
}
function clean($contents)
{
return $contents = str_replace('<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAA6ElvpTmZs4PUpZpSAoK6BSHXJsp5oogWH5jZodYSc2VMsh-GBSvecccQD_seEoYLmo-SsWfitQQEw" type="text/javascript"></script>', '', $contents);
}
function get($url)
{
$this->curl = curl_init($url);
$this->setup();
return $this->clean($this->request());
}
function getAll($reg,$str)
{
preg_match_all($reg,$str,$matches);
return $matches[1];
}
function postForm($url, $fields, $referer='')
{
$this->curl = curl_init($url);
$this->setup();
curl_setopt($this->curl, CURLOPT_URL, $url);
curl_setopt($this->curl, CURLOPT_POST, 1);
curl_setopt($this->curl, CURLOPT_REFERER, $referer);
curl_setopt($this->curl, CURLOPT_POSTFIELDS, $fields);
return $this->request();
}
function getInfo($info)
{
$info = ($info == 'lasturl') ? curl_getinfo($this->curl, CURLINFO_EFFECTIVE_URL) : curl_getinfo($this->curl, $info);
return $info;
}
function request()
{
return curl_exec($this->curl);
}
}
class Signup extends Curl
{
function random_str($length = 13, $chars = 'all')
{
if($chars == 'all')
$base = 'ABCDEFGHKLMNOPQRSTWXYZabcdefghjkmnpqrstwxyz1234567890';
elseif($chars == 'letters')
$base = 'ABCDEFGHKLMNOPQRSTWXYZabcdefghjkmnpqrstwxyz';
elseif($chars == 'upper')
$base = 'ABCDEFGHKLMNOPQRSTWXYZ';
elseif($chars == 'lower')
$base = 'abcdefghjkmnpqrstwxyz';
elseif($chars = 'num')
$base = '1234567890';
elseif($chars = 'upper_num')
$base = 'ABCDEFGHKLMNOPQRSTWXYZ123456789';
elseif($chars = 'lower_num')
$base = 'abcdefghjkmnpqrstwxyz123456789';
else { $base = $chars; }
$max = strlen($base) - 1;
$out = '';
mt_srand((double)microtime()*1000000);
while (strlen($out) < $length + 1)
$out .= $base{mt_rand(0, $max)};
return $out;
}
}
go to next post....