it's hard for me to tell only seeing the small snippet. Are you sure the method of the form is to post? if this code
$status = trim($_POST['S_status']);
is always returning "", then perhaps the form isn't sending the info using the post array, but using the GET array instead.