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
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.