PHP Code:
<?php
/**
* written by mRAza
* 11-09-2011
*
*
* Usage: $link = upFilepost($user,$password,$cookie,$file);
**/
function upFilepost($user,$password,$cookie,$file){
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4)Gecko/20030624 Netscape/7.1 (ax)";
$post = 'email='.$user.'&password='.$password;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://filepost.com/general/login_form/");
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_REFERER, "http://filepost.com/");
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
$result = curl_exec($ch);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://filepost.com/files/upload/");
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_REFERER, "http://filepost.com/");
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
$result = curl_exec($ch);
preg_match("#upload_url: '(.*)'#",$result,$upURL);
$upURL = $upURL[1];
preg_match("#SID: '(.*)'#",$result,$SID);
$SID = $SID[1];
$post = array();
$post['file']="@$file";
$post['SID']=$SID;
$post['Filename']= basename($file);
$post['Upload']="Submit Query";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $upURL);
curl_setopt($ch, CURLOPT_USERAGENT, 'Shockwave Flash');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
$result = curl_exec($ch);
preg_match("#answer\":\"(.*)\"#",$result,$answer);
$answer = $answer[1];
if ($answer ){
$url = 'http://filepost.com/files/done/'.$answer.'/?JsHttpRequest';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_REFERER, "http://filepost.com/");
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
$result = curl_exec($ch);
curl_close($ch);
preg_match("#id=\"down_link\" class=\"inp_text\" value=\"(.*)\"#",$result,$link);
if($link) {
return $link[1];
}
}
return false;
}
?>
themaCreator - create posts from...
Version 3.24 released. Open older version (or...