New Zenner
- Join Date:
- May 2008
- Posts:
- 31
- Plugin Contributions:
- 0
Problem redirecting to another page
I have made modifications to allow php scripts in ezpages. Now I want to create a new page that is only available to members who are signed in. I have put the following code in to see if there is a session variable present. If so, I would like to show the page to the user. If not, I want the user to be redirected to the login page.
Here is the code I have at the very top of the page:
<?php
if (empty($_SESSION['customer_id'])) {
header("Location: index.php?main_page=login");
exit;
}
else {
/*here is the stuff that gets shown to the user */
}
?>
The results I'm getting:
When I am logged in, I see all the content -> GREAT!
When I'm not logged in, the page is blank and I don't get redirected.--> BAD!
When I test the header() redirect in a test file in the Catalog directory, it works. Is this a permissions problem?
Any suggestions are appreciated. Thanks, D