Grabbing $_POST data
Solutions
This wasn't a Drupal problem at all.
My problem was that I was getting an empty $_POST array when I tried to process a naive HTML form with naive PHP. I was blaming this on Drupal because I'm unfamiliar with it but know enough about it to know that it changes the way $_SESSION variables are to be handled (as arrays) and that we are on a pretty non-standard setup (as mentioned in the question).
The actual cause of the problem was something else entirely. It was a series of warnings in my Apache error logs that gave it away.
Part of what I was doing to sanitize the input from users was to use mysql_real_escape_string()
on input. I didn't realize that this actually required an active connection to a mysql db. What was happening was that the Apache user under whom the php was executed did not have valid credentials to the db so the function was returning FALSE when it was unable to connect.
Remedying this situation caused $_POST
to work as expected. It also explains why I couldn't find any documentation on how Drupal breaks $_POST: it doesn't break it.
This answer isn't strictly related to Drupal but I've decided to include it after all so that any poor schmuck who finds himself going down the same dead end I was following can save himself a few hours of googling.
Further, mysql_real_escape_string
is deprecated as of PHP 5.5.0 so you (I) should probably be doing this better anyway. And use Drupal's provided form API instead of rolling your own.
To tackle your exact question, let me first tell you that what happens in the form is the correct thing.
When you submit the form, it takes data, validates it and calls appropriate submit handlers to take care if the rest. The form, once its routing is completed, does a 302 redirect to the same location so a browser F5 hit does not resubmit data. It's a general practice to avoid double submissions.
You will need to make a module that alters the form using hook_form_alter and alter the form.
You can change form's action URL to the other PHP file or add an extra submit handler that posts data to the other raw php file using drupal_http_request.
You will find sanitized and structures data in $form_state['values'] (second param of a submit handler is usually called $form_state). $_POST is also available at this stage.