-4
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();
                    }

this is my code and I want to redirect the page after executing this code

  • just use `header("Location: your_page.php");` before `die()` function !! where is the issues – PacMan Mar 10 '17 at 18:13
  • its showing error XMLHttpRequest cannot load (https://www.abc./). No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ('https://dev1.abc.') is therefore not allowed access. – Shabbir Lokant Mar 10 '17 at 18:19
  • check this post it may be helpful `http://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource` – PacMan Mar 10 '17 at 18:22

1 Answers1

0

just use header("Location: your_page.php"); before 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();
                        }

if error

add fist line 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();
                            }?>
Dhiarj Sharma
  • 328
  • 3
  • 12