whereas the main information for the code I'm writing needs to show the full domain name
You can always manually write in the full URL, right?
Conversely, you could use:
<form action="http://<?php
echo $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
?>" method="post">
or if you wish to keep the query string,
<form action="http://<?php
echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
?>" method="post">