I've got a registration page and a landing page, when the register button is pressed it activates a JS function in an external JS file (reg.js) that then runs reg.php, like so:
reg.html->reg.js->reg.php
If the registration succeeds it is supposed to redirect to a landing page (landing.php) but instead it is just appending the landing page to the bottom of the current page(reg.html), like so:
Register
[register button]
Landing
[landing page text]
The redirection code is:
header('Location: landing.php');