GsXtAsY Posted July 31, 2008 Share Posted July 31, 2008 I want to check to see if the user is logged in before they can access this page...its telling me to add checkLogin('2') after the session starts but when i do that I get an error of: Fatal error: Call to undefined function: checklogin() in /home/nlvip/public_html/index.php on line 3 Any Suggestions? <?php session_start(); require_once('includes/db_login_evp.inc'); require_once('includes/functions/site_display.inc'); require_once('includes/functions/session_control.inc'); $username = $_POST['username']; $thanks = $_SESSION['thankyou']; $email = $_SESSION['work_email']; $_SESSION = array(); // clear session whenever user comes to front page // --- PAGE SPECIFIC CODE --- // // get account_id from nickname in URL if($_GET['name']){ $account_set = session_load_account_from_name($_GET['name']); }elseif($_GET['id']){ $account_set = session_load_account($_GET['id']); } if($account_set){ // forward to next page if($_SESSION['paid_options']){ $goto = 'paid_option.php'; }else{ $goto = 'welcome.php'; } insert_track($PHP_SELF); // insert tracking info into DB header('Location: http://www.nationlinkvip.com/'.$goto); exit; } // end if login has been selected insert_track($PHP_SELF); // insert tracking info into DB // --- SITE-WIDE CODE --- // // Account Logo $logo = display_account_logo($_SESSION['account_logo']); // Get Random Testimonial $testimonial = get_testimonial(); // Get Banner Image $banner_img = set_banner(); // Set welcome message $welcome_msg = set_welcome_message($_SERVER['PHP_SELF']); // Custom Account Content //$photo_banner = get_special_page('photo_banner.tpl'); //$left_column_nav = get_special_page('left_column_nav.tpl'); $right_column_content = get_special_page('evphome.tpl'); //$footer = get_special_page('footer.tpl'); // overide to eliminate sprint branding if(!isset($_SESSION['account_id'])){ //$style .= "\n\t".'<style type="text/css" media="all"><!-- body{background: #3E3629;} --></style>'; //$left_column_nav = 'evp/noSprint/left_column_nav.tpl'; //$footer = 'evp/noSprint/footer.tpl'; } // --- APPLY SMARTY TEMPLATE --- // include('smarty/Smarty.class.php'); $smarty = new Smarty; // Standard $smarty->assign('title', 'Home'); $smarty->assign('style', $style); $smarty->assign('javascript', $javascript); $smarty->assign('account_logo', $logo); $smarty->assign('offer_bar', $welcome_msg); $smarty->assign('left_column_nav', $left_column_nav); $smarty->assign('right_column_content', $right_column_content); $smarty->assign('footer', $footer); // Additional $smarty->assign('photo_banner', $photo_banner); $smarty->assign('testimonial', $testimonial); $smarty->assign('thanks', $thanks); $smarty->assign('email', $email); $smarty->assign('username', $username); // Display the page $smarty->display('evp/index1.tpl'); ?> Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 31, 2008 Share Posted July 31, 2008 What's telling you add checkLogin('2')? >_> You never wrote the function. Quote Link to comment Share on other sites More sharing options...
GsXtAsY Posted July 31, 2008 Author Share Posted July 31, 2008 session_start(); checkLogin('1 2'); Thats how it looks in my file...i am using PHP Login and their Help file says to protect pages check pages using checkLogin('1 2'); to make sure user is logged in Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 31, 2008 Share Posted July 31, 2008 My personal suggestion is to just wrote your own login system, but since I doubt you'll take my advice, make sure that you have the function included and defined properly. Quote Link to comment Share on other sites More sharing options...
GsXtAsY Posted July 31, 2008 Author Share Posted July 31, 2008 I do not want them to be able to just type the page name in manually and get the page to display...I need to find a way to check to make sure the user is logged in and if the user is not logged in then take them to login.php Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 31, 2008 Share Posted July 31, 2008 Make sure the function is defined. Quote Link to comment Share on other sites More sharing options...
GsXtAsY Posted July 31, 2008 Author Share Posted July 31, 2008 where do I define the function? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 31, 2008 Share Posted July 31, 2008 I don't know, I have no idea what "PHP Login" is. There's probably 45 scripts named that on Hotscripts or something. It should be defined someone already. Make sure it is and make sure that file is included. Quote Link to comment Share on other sites More sharing options...
GsXtAsY Posted July 31, 2008 Author Share Posted July 31, 2008 the thing is im incorporating it into files that I have created myself ... so the index.php file that i listed above is all my code and im trying to get this script to check my pages so someone cant go any further if they didnt log in yet at login.php 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.