-
- 13 Posts
How would I go about creating a snippet or something to redirect a user if their not logged in to page 1 or if their logged in redirect them to page 2 (two snippets obviously). This is because I would like to keep parts of my site secret but allowing them to go to a page, even if their isnt content shown gives the game away. I’d use the member check snippet but I’m keeping my users as ManagerUsers to allow them to edit content.
Any help would be appreciated.
-New to this whole CMS thing so excuse the retardedness of any of my posts.
-
- 788 Posts
something like this should work...
// redirect snippet
$notlogged_location ="index.php?id=##";
$islogged_location ="index.php?id=##";
if(!isset($_SESSION['webValidated'])){
header("Location: $notlogged_location");
}else{
header("Location: $islogged_location");
}
-
- 13 Posts
Thanks a lot. I’ll try it out now.
-New to this whole CMS thing so excuse the retardedness of any of my posts.
-
- 13 Posts
Ok, with a little modification heres the redirect to logged out page thang I got
<?php
// redirect snippet
$notlogged_location ="index.php?id=1";
if(!isset($_SESSION[’mgrValidated’])){
header("Location: $notlogged_location");
}
?>
It seems to work nicely. Thanks a lot.
-New to this whole CMS thing so excuse the retardedness of any of my posts.