Witam,
mam mały problem z rejestracja uzytkowników na stronie,
posiadam mały skrypt na rejestracje, jednakże przy rejestracji, wyświetla błąd,
"Error in signup procedure".
W czym może być problem?
Oto skrypt:
<?php
// include config file
require_once("config.php");
// include files
require_once(INC_ROOT."/dblayer.php");
require_once(INC_ROOT."/system.php");
require_once(INC_ROOT."/users.php");
// initialise db access
$db->connect();
$showform = false;
$err_msg = '';
$redirect_to = WEB_ROOT.'/home.php';
if ( isset($_POST['signup']) ) { // form was submitted and try to signup user $username = $_POST['username'];
$password = $_POST['password'];
$password2 = $_POST['password2'];
$email = $_POST['email'];
if ( $password == $password2 ) {
if ( !user_load('',$username) ) {
if ( user_signup($username, $password, $email) ) {
$showform = false;
user_login($username, $password); // chg this for different authentication method
$u = user_load($username);
// print_r($u);
header("Location: http://" . $_SERVER['HTTP_HOST'] .$redirect_to); } else {
echo "Error in signup procedure"; }
} else {
$showform = true;
$err_msg = 'Username already exists. Please choose another username';
}
} else {
$showform = true;
$err_msg = 'Both passwords should be identical.';
}
} else { // no form was submitted
$showform = true;
}
if ( $showform ) {
if ( is_login() ) { // logged in
header("Location: http://" . $_SERVER['HTTP_HOST'] .$redirect_to); } else { // not yet logged in
$qb_title = 'konto utworzone';
include("inc/header-meta.inc");
include("inc/qb-static-header.inc");
include("inc/grey-header.inc");
include("inc/content-signup.inc");
include("inc/content-footer.inc");
include("inc/grey-footer.inc");
include("inc/qb-static-footer.inc");
}
}
?>
Pozdrawiam.