Jump to content

Check Login


GsXtAsY

Recommended Posts

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');

?>

Link to comment
https://forums.phpfreaks.com/topic/117636-check-login/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.