Code: Select all
<form action="{AJAX_URL}" method="POST" id="fbpost" data-ajax="register_ajax">
<input id="name" name="name" type="hidden" />
<input id="email" name="email" type="hidden" />
</form>
Code: Select all
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
exit();
-----------------------------------------
อีกวิธีที่อยากให้มันทำงาน ส่ง json ออกมาเเล้วใช้ jquery เปลี่ยนหน้าเเทน
Code: Select all
$json_response = new \phpbb\json_response;
$json_response->send(array(
'redirect' => TRUE,
));
Code: Select all
(function ($) {
//
"use strict";
phpbb.addAjaxCallback('register_ajax', function (data) {
// console.log(data);
if (data.redirect == true) {
window.location.href = "{REDIRECT}";
}
if(data.login_register == true){
window.location.href = "{LOGIN_REGISTER}";
}
});
})(jQuery);