Looks like you are already setting the username into a session variable, and to be able to print that on a different page than the page you want it printed on, needs to be *.php instead of *.html
So you would have to change home.html to home.php so you would be able to use PHP there, and then you would simply echo the $_SESSION['userName'] to display the
user name!!! The problem in your code there though is you have $row['
pass'] being set to $_SESSION['
userName'].
Then in index.
php you would echo the $_SESSION['userName'] where you want the username to appear.
You can use the shorthand method to echo the $_SESSION['userName'] (just make sure this is enabled in Apache)
<?=$_SESSION['userName'];?>
or you can use the normal method. Neither is faster as far as I know.
<?php echo $_SESSION['userName'];?>
Also, you are not sanitizing/validating the user submitted values.
Stack overflow has a solution for this... a pretty detailed one. Check it out for your data validation and sanitation.