function upFS($value, $fs_user, $fs_password) {
$post = array();
$post["autoLogin"] = true;
$post["loginUserName"] = $fs_user;
$post["loginUserPassword"] = $fs_password;
$post["loginFormSubmit"] = TRUE;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://fileserve.com/login.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
curl_setopt($ch, CURLOPT_REFERER, "http://www.fileserve.com/login.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
$result1 = curl_exec ($ch);
curl_close ($ch);
$result = $result1;
//echo $result."<br />";
preg_match("/cookie=[a-zA-Z0-9%]+/i", $result, $matches);
$doughnut = $matches[0]; //This is the cookie
//echo $doughnut."<br />";
$result = postHost("http://www.fileserve.com/", "", $doughnut);
preg_match('/id="uploadHostURL" value="(.+?)"/', $result, $matches);
$uploadHostURL = $matches[1];
preg_match('/id="userId" value="(.+?)"/', $result, $matches);
$userId = $matches[1];
$result = postHost("http://www.fileserve.com/upload-track.php", "", $doughnut);
preg_match('/sessionId":"(.+?)"/', $result, $matches);
$sessionId = $matches[1];
$action_url = "http://".$uploadHostURL."/upload/upload.php?X-Progress-ID=".$sessionId;
preg_match('/fs(.+?)u/', $uploadHostURL, $matches);
$serverID = $matches[1];
$post = array();
$post["affiliateId"] = "";
$post["subAffiliateId"] = "";
$post["landingId"] = "";
$post["userId"] = $userId;
$post["uploadSessionId"] = $sessionId;
$post["uploadHostURL"] = $uploadHostURL;
$post["serverId"] = $serverID;
$post["file"] = "@$value";
$uploadThis = postHost($action_url, $post, $doughnut);
$result = postHost("http://www.fileserve.com/upload-result.php", "uploadSessionId[]=$sessionId", $doughnut);
preg_match("/http:\/\/www.fileserve.com\/file\/[0-9a-zA-Z]+/i", $result, $matches);
if ($matches[0]==null){$link=null;}
else{$link = $matches[0]."/".basename($value);}
return $link;
}
this is my...please help to mod it :D