The following function is not working. I cannot see why.
function access_apply($email,$pwd,$forname,$surname,$postcode,$telephone,$mobile){
global $cnx;
$pwd = bcrypt_hash($pwd);
$q = $cnx->prepare("INSERT INTO `users` (email, pwd, forename, surname, postcode, telephone, mobile) VALUES (:email, :pwd, :forename, :surname, :postcode, :telephone, :mobile)");
$q->execute(array(':email' => $email, ':pwd' => $pwd, ':forename' => $forename, ':surname' => $surname, ':postcode' => $postcode, ':telephone' => $telephone, ':mobile' => $mobile));
}
Once it is called the code breaks and nothing further is executed.
Looks like it might be a typo in the function parameters. One is $forname, and you assign $forename in the array. So it may be an undefined variable, or a parameter count mismatch that is occurring.