Всем привет!
Не как не могу решит проблему с редиректом(
header( 'Refresh: 2; url=/app/success.php' ); выдает ошибку
"Warning: Cannot modify header information - headers already sent by"
if( isset($_POST['user_Email'], $_POST['user_birthsday'], $_POST['user_pass'], $_POST['user_RePass']) ) {
//reg
$errors = array();
if(R::count('users', "email = ?", array($data['user_Email'])) > 0) {
$errors[] = 'already reg';
}
if(empty ($errors)) {
$user = R::dispense('users');
$user->email = $data['user_Email'];
$user->birthsday = $data['user_birthsday'];
$user->password = password_hash($data['user_pass'], PASSWORD_DEFAULT);
R::store($user);
$reg = R::findOne('users', 'email = ?', array($data['user_Email']));
var_dump($_SESSION['reg_user'] = $reg);
header( 'Refresh: 2; url=/app/success.php' );
} else {
$error = array_shift($errors);
return $error;
}
}