if ($this->register($email, $register_status))
{
$this->sendConfirmationEmail($email);
echo json_encode(array("message" => $this->error = $this->l('Your email was registered. Thank You!'),"code" => 1));
die();
}
这是我的代码,我想在执行此代码后重定向页面
答案 0 :(得分:0)
只需使用标题(“Location:your_page.php”);在die()之前;
if ($this->register($email, $register_status))
{
$this->sendConfirmationEmail($email);
echo json_encode(array("message" => $this->error = $this->l('Your email was registered. Thank You!'),"code" => 1));
header("Location: your_page.php");
die();
}
如果错误
添加拳头线toppage
<?php
ob_start();
if ($this->register($email, $register_status))
{
$this->sendConfirmationEmail($email);
echo json_encode(array("message" => $this->error = $this->l('Your email was registered. Thank You!'),"code" => 1));
header("Location: your_page.php");
die();
}?>