Hmmm let's see if I can make sence of what I'm trying to do here ;) I am using hidecategories_1-10 so I can hide my categories and use a direct link. In addition to that I have added a new field to the table categories (I know I should make a table on it's own ;) ) so I can force a login to a specific category.

Like this:
Code:
$login_on_off_query = "SELECT login_on_off FROM categories WHERE categories_id = " . $cPath;
$login_on_off_query = $db->bindVars($login_on_off_query, ':languageID', $_SESSION['languages_id'], 'integer');
$login_on_off = $db->Execute($login_on_off_query);
And
Code:
if(empty($_SESSION['customer_id']) && $login_on_off->fields['login_on_off'] == 1){
echo header('Location: index.php?main_page=login');
Everything works but the problem is the login part. I want the visitor to be redirected back to where the visitor came from. In other words if the visitor is in directory x and got a login box I want the visitor to be redirected to directory x after he or she logged in.

Thanks for a great script!

Best regards

ChrisL