the code for the link is not correct, it is missing the name of the access check url variable.
this code:
<a href="userdata_LogIn.php?<?php (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>">
should be:
<a href="userdata_LogIn.php?accesscheck=<?php (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>">