stripslashes($_POST["title"]),
"url" => $url,
"image" => stripslashes($_POST["IMG"]),
"audio" => stripslashes($_POST["AUD"]),
"comment" => stripslashes($_POST["comment"]),
"poster" => $poster
);
$tdtime = new DateTime(null, new DateTimeZone($timezone));
$today = $tdtime->format('m.d.y');
$now = $tdtime->format('H:i:s');
$newsdir = $_SERVER["DOCUMENT_ROOT"].'/'.$basedir.$microblogdir;
@mkdir($newsdir.$today);
$fh = fopen($newsdir.$today."/".$now, 'w');
if (!$fh) die("ERROR: couldn't write $newsdir$today/$now to $newsdir$today, check permissions");
fwrite($fh,json_encode($postBody));
fclose($fh);
} else {//Print errors at the top, since we didn't have what we needed from POST
$message = 'Could not post due to errors:
Submissions: