There are two way to refer a form back to the same page:
<?php
$action = $_SERVER['PHP_SELF'];
$action_all_included = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
?>
Considering we are now at www.example.com?id=3 then this is what the two variables will contain:
$action: www.example.com
$action_all_included: www.example.com?id=3
PHP_SELF will give you the actual address while QUERY_STRING will give you, well, the query string. You'll have to add the question mark yourself.