For example, user work with a site, fill the form with some information and click a button or just click a link, but server finds that user in not logged in (any more, for some reasons). Server have to send a login form to user, user fill login form and click OK, after that user have to be send to request page, i.e. like he filled form or clicked an uri link (isn't it?). So, preserving $_GET looks easy --- use $_SERVER["REQUEST_URI"]
echo '<form action = "'.$_SERVER["REQUEST_URI"].'" method = "post">'.
'<input type = "text" name = "login">'.
'<input type = "password" name = "password">'.
'<input type = "submit" value = "OK" name = "login_form">'.
'</form>';
but how to preserver $_POST? Am I to iterate through all elements of this array to create hidden inputs in this form or there is an idea to do it more easily?