Can some one please help with a register form for a website? I can't get it to load information to database.
prepare($query); $statement->bind_param('ssssissiisss', $firstname, $lastname, $streetAddress, $suburb, $postcode, $state, $country, $phone, $mobile, $email, $dateJoined, $password); $statement->execute(); $statement->store_result(); $creationWasSuccessful = $statement->affected_rows == 1 ? true : false; if ($creationWasSuccessful) { $userId = $statement->insert_id; $addToUserRoleQuery = "INSERT INTO users_in_roles (user_id, role_id) VALUES (?, ?)"; $addUserToUserRoleStatement = $db->prepare($addToUserRoleQuery); // this puts all users into standard user role. in other websites there may be different levels of access $userRoleId = 2; $addUserToUserRoleStatement->bind_param('dd', $userId, $userRoleId); $addUserToUserRoleStatement->execute(); $addUserToUserRoleStatement->close(); //$_SESSION['userid'] = $userId; )this is not being used here -- header has session include //$_SESSION['username'] = $username; ) if removed? do we need else function? // header ("Location: home.php"); ) } else { echo "Failed registration"; /*? do we need this ?*/ } } include ("includes/header.php"); ?>
Register
First Name |
|
Last Name |
|
Email |
|
Password |
|
Reenter Password |
|
Street Address |
|
Suburb |
|
Postcode |
|
State |
|
Country |
|
Phone |
|
Mobile |
|
By registering, you agree to comply with the Australian Lightning Club Terms and conditions
Cancel
1 Answer(s)