This is a simple login script using Bcrypt.  Is there anything wrong with this code? It works and my page loads O.K, but could this be optimized for better speeds? <!Doctype html>    <html>    <head>    <title>password validation</title>    </head>    <body>    <fieldset>    <legend>Sign-In</legend>    <form action =passing.php method = post>    <table>    <tr>    <td>Email:</td><td><input type=id name =id /><br /></td>    </tr>    <tr>     <td>Password:</td><td><input type = password name=password />  <br /></td>    </tr>    </table>    <input type = submit name =submit value =insert />    </form>     </fieldset>     <br />    <?php     // connect to the server    $conn = new mysqli('localhost', 'root', '', 'social');     // check connection    if(mysqli_connect_errno()) {        exit(connection failed . mysqli_connect_error());      }    else {       echo connection established;    }if($_POST && isset($_POST['submit'], $_POST['password'],       $_POST['id'])) {    $pass = ($_POST[password]);    $userName = ($conn, $_POST[id]);    $input = $pass; //Is this wrong to do?    $query = mysqli_prepare($conn, SELECT pass FROM social    WHERE  email = ?); //is this query safe?    mysqli_stmt_bind_param($query,'s', $userName );    mysqli_stmt_execute($query);        mysqli_stmt_bind_result($query, $userName);if(mysqli_stmt_fetch($query)) {    echo <br />;    echo SUCCESS at query;if (password_verify($input, $userName)) {    echo matching pass . header(Location: inserh.php);   }  else{     echo not a  match;       }     }   }mysqli_close($conn); // close the connection!!!!!!!!!!!!!
Simple login script
php;html;authentication