Rule #1 when working with forms:
All form processing MUST occur on the page that is the action attribute of the form tag.
the form tag:
<form action="cp.php" method="post" id="enter">
action attribute on your page is to send the form post to the cp.php page
this means that the login behavior that is on the enter.php page will never be executed. when the form submit button is pressed, the form data is sent to action page, in this case the cop.php page.
for the login behavior that is on the enter.php page to be able to run, the action of the form needs to be set to the enter.php page.
<form action="enter.php" method="post" id="enter">