Guest rembot Posted July 23, 2005 Share Posted July 23, 2005 Hey all, I was just wondering if anyone out there could help me. All my friends that know php seem to hate cube cart and because of that won't help >.< ok first thing you need to know is im adding other pages onto cube cart. The visitor will click the link and the popup will load. Now this popup needs to have a script to make sure only logged in users can view it.... to put it really simply i need a script that goes: check cube cart session, if session exists continue to load popup else redirect to register page. I would really love some help Thanks Sam Quote Link to comment Share on other sites More sharing options...
Guest wow1111 Posted July 23, 2005 Share Posted July 23, 2005 this is what cubecart does with the welcome message.... if($ccUserData[0]['customer_id']>0){ $box_content->assign("LANG_WELCOME_BACK",$lang['front']['boxes']['welcome_back']); $box_content->assign("TXT_USERNAME",$ccUserData[0]['firstName']." ".$ccUserData[0]['lastName']); $box_content->assign("LANG_LOGOUT",$lang['front']['boxes']['logout']); $box_content->assign("LANG_YOUR_ACCOUNT",$lang['front']['boxes']['your_account']); $box_content->parse("session.session_true"); } else { $box_content->assign("LANG_WELCOME_GUEST",$lang['front']['boxes']['welcome_guest']); $box_content->assign("VAL_SELF",urlencode(currentPage())); $box_content->assign("LANG_LOGIN",$lang['front']['boxes']['login']); $box_content->assign("LANG_REGISTER",$lang['front']['boxes']['register']); $box_content->parse("session.session_false"); } $box_content->parse("session"); $box_content = $box_content->text("session"); ( /includes/boxes/session.inc.php ) hope this helps !? Quote Link to comment Share on other sites More sharing options...
Guest rembot Posted July 23, 2005 Share Posted July 23, 2005 nah, not really. It just confused me. i was using this <php? // INCLUDE CORE VARIABLES & FUNCTIONS include_once("includes/global.inc.php"); if(!isset($_SESSION['ccUser']) || $results == FALSE header("Location: index.html"); ?> but it doesnt work >.< can anyone else help? Quote Link to comment Share on other sites More sharing options...
convict Posted July 23, 2005 Share Posted July 23, 2005 Your code is eventless. Just insert little bit more 'inludes' at first :) Quote Link to comment Share on other sites More sharing options...
Guest rembot Posted July 24, 2005 Share Posted July 24, 2005 so what you are saying is this should make it better? <php? // INCLUDE CORE VARIABLES & FUNCTIONS include_once("includes/global.inc.php"); // initiate db class include_once("classes/db.inc.php"); $db = new db(); include_once("includes/functions.inc.php"); $config = fetchDbConfig("config"); include_once("includes/sslSwitch.inc.php"); // get session data include_once("includes/session.inc.php"); if(!isset($_SESSION['ccUser']) || $results == FALSE header("Location: index.html"); ?> well i don't think it does i can't see any other includes that look relevant. Can anyone tell me if it's a problem in my actuall php code. Quote Link to comment Share on other sites More sharing options...
convict Posted July 24, 2005 Share Posted July 24, 2005 OMG, little bit better however <php? does your code 'incurable' , IF condition SYNTAX ERROR and useless. Look at this <? include_once("includes/global.inc.php"); session_start(); include_once("classes/db.inc.php"); $db = new db(); include_once("includes/functions.inc.php"); $config = fetchDbConfig("config"); include_once("includes/sslSwitch.inc.php"); include_once("includes/session.inc.php"); if($ccUserData[0]['customer_id']>0){ echo "i am logged in"; } else { echo "i am NOT logged in"; } ?> I think that next steps are completely clear Regards Quote Link to comment Share on other sites More sharing options...
Guest awx2d Posted October 16, 2008 Share Posted October 16, 2008 I know this is an old post but I have modified the output of this code though it does not detect .. $ccUserData[0]['customer_id']>0 .. for some reason, I would really appreciate it if someone could advise why and offer a solution. Quote Link to comment Share on other sites More sharing options...
Guest moonriver82 Posted September 22, 2011 Share Posted September 22, 2011 hmm this didn't work for me Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.