<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName");
curl_setopt($ch, CURLOPT_URL,"http://www.uploaded.to/login");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "email=EMAIL&password=PASSWORD");
ob_start(); // prevent any output
curl_exec ($ch); // execute the curl command
ob_end_clean(); // stop preventing output
curl_close ($ch);
unset($ch);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName");
curl_setopt($ch, CURLOPT_URL,"http://www.uploaded.to/home");
$buf2 = curl_exec ($ch);
curl_close ($ch);
unset($ch);
//echo ($buf2); //$buf2 enthaelt eine HTMLseite die mir erzaehlt dass ich eingeloggt bin...
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName");
curl_setopt($ch, CURLOPT_URL,"http://uploaded.to/
api/uploadserver");
$uploadserver = curl_exec ($ch);
curl_close ($ch);
unset($ch);
$uploadserver .='up?output=
xml&upload_id='. rand(100000000, 999999999);
$uploadfile = 'testdata.xml';
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL,$uploadserver);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
array('file1x'=>"@$uploadfile"));
$result = curl_exec ($ch);
curl_close ($ch);
unset($ch);
echo $result;
?>