I'd suggest moving from mysqli_* to PDO.
I don't really use mysqli_* but this should work. If it doesn't, post all the code you're using to make it easier.
Also you were missing a bracket beside your else {
require 'constants.php';
include_once 'menu.php';
if( isset($_POST['register']) )
{
$dbc = mysqli_connect(HOST,USERID,PASSWORD,DB);
$stmt = mysqli_prepare( $dbc, "INSERT INTO users (userid, password) VALUES ( :userid, :password )" );
$stmt = mysqli_execute(':userid' =>$_POST['userid'], ':password' => $_POST['password']);
include('PasswordHash.php');
$pwdHasher = new PasswordHash(8, false);
$hash = $pwdHasher->HashPassword($_POST['password']);
mysqli_stmt_bind_param($stmt,'ss',$_POST['userid'],$hash);
$result = mysqli_stmt_execute($stmt);
} else {
$_SESSION['uid']= $userid;
include_once 'displayChat.php';
}