To pass data between files, like login.php, home.php, use <? session_start()?>.
isset($_POST) to check if the page is open by URL or submition.
"<?php echo $_SERVER['PHP_SELF']; ?>" to make a self direct form.
To stop some special characters from being interpreted, use the HTMLSPECIALCHARS() to present the exactly original input.