The problem looks similar to the first one, you are missing a sever variable that should be referenced in this line of code.
this code:
<form action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["]):""));?>" method="post" name="WAATKLogInForm" id="WAATKLogInForm">
should be like this:
<form action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));?>" method="post" name="WAATKLogInForm" id="WAATKLogInForm">
I'm not sure why the second reference to the $_SERVER['query_string'] is not correct for you, this is why I was asking about any modifications that you have done to the code after the fact.