Hi all,
I'm using an ajax call to trigger a php redirect using headers. According to chrome's developer tools the content of the page is loaded (ie: is in the resource list), but the page never redirects.
I'm not getting any error codes. Here's the php:
<?php
ini_set('display_errors', false);
if (!isset($_SESSION)) {
if($_POST['email']){
...several calls to external db...
if(strlen($response->supporter->item->Email))
//user is a member
header('Location: http://www.example.com/page-one/');
else
header('Location: http://another-site.com/');
}
}
?>
Nearly exactly the same code works in another part of the site. Any ideas why this is pulling the correct content, but not loading it on the page?
the ajax call is:
$.post("http://www.our_site.org/is_member.php", { email: email });