Hi guys, I have a slight problem with the redirect from the login page/registration, I'll explain: in my site use a lot of extra pages to present the products.

in these extra pages there is a button that leads to files that are in a folder in the root directory but that is not a zen cart folder.

I would that the user has logged in before accessing these files, so if the user click on the button to access these files without being logged in is redirected to the login page.

The ideal for me would be to redirect the user to these files after login (if coming from these extra pages), but I've seen is a bit 'problematic doing a redirect to non zen cart files and I would be fine also redirect the extra page of origin.

I made it in this way:

The extra page of origin sends the customer ID through get to the landing page (the non zen cart file) and in the landing page I entered:

Code:
if($_GET['customers_id']==''){
header('Location: http://www.mysite.com/index.php?main_page=login&page=page');
}
and it works, it will redirect to the login page if the user is not logged sending with get the variable "page"

then I inserted in the file includes/modules/page/login/header_php.php this code

Code:
if ($_GET['page']!='') {
  if ($origin_href != zen_href_link(FILENAME_DEFAULT)) {
    zen_redirect($origin_href);
  }
}

but it doesn't work, someone could help me?

Thanks to anyone who wants to answer

the version of zen cart is 1.3.9h