$create_user->bindParam(':email', $email, PDO::PARAM_STR); $create_user->bindParam(':bio', $bio, PDO::PARAM_STR); $create_user->bindParam(':key', $key, PDO::PARAM_STR); $create_user->bindParam(':verified', $verified, PDO::PARAM_INT); $create_user->bindParam(':join', $join, PDO::PARAM_STR); $create_user->execute(); } catch (PDOException $e) { $log->logError($e . " - " . basename(__FILE__)); } $err = "<div class=\"alert alert-success\"><strong>" . _("User Added.") . "</strong><br/>" . _("A new user has been added successfully.") . "</div>"; } else { $err = "<div class=\"alert alert-error\"><strong>" . _("Email already exists.") . "</strong><br/>" . _("This email is already registered with us.") . "</div>"; } } else { $err = "<div class=\"alert alert-error\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button><strong>" . _("Invalid Email.") . "</strong><br/>" . _("Please enter a valid email address in the email field.") . "</div>"; } } else { $err = "<div class=\"alert alert-error\"><strong>" . _("Empty Fields.") . "</strong><br/>" . _("Please fill in all the fields.") . "</div>"; } } /* displaying the user info edit page to the admin. */ admin_add_user(); } else { echo "<div class=\"alert alert-error\"><strong>" . _("Unauthorized Access.") . "</strong><br/>" . _("You are not authorized to access this page.") . "</div>"; } } else { echo "<meta http-equiv=\"refresh\" content=\"0;url={$website}/" . USER_DIRECTORY . "/login\" />"; } include "../" . USER_DIRECTORY . "/footer.php";
<div id="body_wrap"> <nav id="nav"> <ul> <li><a href="recom.php">recommendations</a></li> <li><a href="blog.php">blog</a></li> <li><a href="includes/logout.php">log out</a></li> <li><a href="admin.php">admin page</a></li> <li><a href="../ro/login.php">ro</a></li> </ul> <div id="logo"><a href="index.php"><img src="img/provisory-logo.gif"></a></div> </nav>'; echo '<h3 class="reg_success">User added successfully!</h3>'; } else { if (empty($_POST) === false && empty($errors) === true) { $register_data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'first_name' => $_POST['first_name'], 'email' => $_POST['email'], 'active' => isset($_POST['active']) ? 1 : 0); admin_add_user($register_data); header('Location: add_user.php?success'); exit; } else { if (empty($errors) === false) { echo output_errors($errors); } } ?> <body> <div id="body_wrap"> <nav id="nav"> <ul> <li><a href="recom.php">recommendations</a></li> <li><a href="blog.php">blog</a></li> <li><a href="index.php#contact">contact</a></li>