Hello.
$argv will contain the command line arguments. See what the array contains using this code.. and work that in...
<?php var_dump($argv); ?>
You can load the description using file_get_contents();
<?php $description = file_get_contents('/path/to/description.txt'); ?>
You can use basename() to work out 'invoice.doc' from the full file path as demonstrated below.
<?php $basename = basename('/path/to/income.doc'); ?>
You can then use fsockopen/fputs to post to a server.
function post_to_host($host, $path, $data)
{
$handle = fsockopen($host, 80);
fputs($handle, "POST $path HTTP/1.1\r\n");
fputs($handle, "Host: $host\r\n");
fputs($handle, "Content-Type: application/x-www-form-urlencoded\r\n");
fputs($handle, "Content-length: " . strlen($data) . "\r\n");
fputs($handle, "Connection: close\r\n\r\n");
fputs($handle, $data);
while (!feof($handle)) { fgets($handle,128); }
fclose($handle);
}
You will need to url encode the data for $data.
Hope this jumbled mess helps you compile a script ^. But I won't do it all for you :P
Jonathan.