I am trying to make a function to upload to freakshare but for the last hours i can't get a good result ....
my code:
if i use $fpost["file"] i get "Fatal error: Cannot unset string offsets in /var/www/fs/x/upload.php on line 16"
if i use $fpost["file[]"] i get "no files"
my code:
PHP:
function freakshareupload($filename,$filelocation,$cookie,$username, $password){
$ref = "http://freakshare.com/";
$page = curl($ref,'',$cookie,$ref);
//echo '<textarea>'.htmlentities($page).'</textarea>';
$url = cut_str($page, '<form action="','" method="post"');
$fpost = array();
$fpost["APC_UPLOAD_PROGRESS"] = cut_str($page, 'name="APC_UPLOAD_PROGRESS" id="progress_key" value="','"');
$fpost["APC_UPLOAD_USERGROUP"] = cut_str($page, 'name="APC_UPLOAD_USERGROUP" id="usergroup_key" value="','"');
$fpost["UPLOAD_IDENTIFIER"] = cut_str($page, 'name="UPLOAD_IDENTIFIER" value="','"');
$fpost["file"] = "@$filelocation";
$uid = 0;
$uid = rand_uid(32);
$url=$url . '?X-Progress-ID=' . $uid;
echo $url;
printr($fpost);
$page = curl_func($url,$fpost,$cookie,$ref,0);
echo '<textarea>'.htmlentities($page).'</textarea>';
}
if i use $fpost["file[]"] i get "no files"