Hi Jerry,
Are you still having issues with the page redirecting on some browsers?
I hadn't noticed earlier, but CMS Builder empties out the $_SESSION array and stores all user data in $CURRENT_USER for security reasons. So to detect if a user is logged in or not I would do this:
if (!defined('START_SESSION')) { define('START_SESSION', true); }
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/hsphere/local/home/a887307/elleschorrphotography.com/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
if (!@$CURRENT_USER['num']){
redirectBrowserToUrl("http://elleschorrphotography.com/cmsAdmin/admin.php?redirectUrl=" . $_SERVER['REQUEST_URI']);
exit;
}
So as the $CURRENT_USER['num'] is a field that can't be changed, I've used it to detect if a user is logged in or not.
Thanks!
Greg
Greg Thomas
PHP Programmer - interactivetools.com