Location: PHPKode > projects > Php simple acces data mysql > phpsimpledb_v2/login.php
<?php
	// lecture du fichier de configuration
	$sThisPath = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
	define( 'PATH_BASE', $sThisPath );
	include_once( PATH_BASE.'configuration.php' );
	
	// si pas besoin du formulaire d'hautentification
	if( !AUTHENT_USE ){
		header( 'Location: '.AUTO_URL_BASE );
		exit();
	}
	if( !isset( $_SESSION ) ){ session_start(); }
	
	// si authentification
	if( isset( $_REQUEST[ 'login' ] ) && isset( $_REQUEST[ 'pass' ] ) ){
		if( $_REQUEST[ 'login' ] == AUTHENT_USER && $_REQUEST[ 'pass' ] == AUTHENT_PASS ){
			$_SESSION[ 'phpsimpledb_login' ] = true;
			header( 'Location: '.AUTO_URL_BASE );
			exit();
		}
	}
	
	//chargement du fichier de langue
	$o = array();
	include_once( PATH_BASE.'langues'.DIRECTORY_SEPARATOR.TAG_LANG.'.php' );
	$oLang = $o;
	
	//moteur de template
	require PATH_BASE.'includes'.DIRECTORY_SEPARATOR.'smarty'.DIRECTORY_SEPARATOR.'smart_site.php';
	$oTemplate = new smarty_site();
	$oTemplate->assign( 'css_http', AUTO_URL_BASE.'templates/'.TEMPLATE_NAME.'/' );
	$oTemplate->assign( 'css_http_base', AUTO_URL_BASE );
	$oTemplate->assign( 'oLang', $oLang );
	
	$oTpl_login = new smarty_site();
	
	$oTemplate->assign( 'body', $oTpl_login->fetch( 'login.html' ) );
	$oTemplate->clear_cache('index.html');
	$oTemplate->display('index.html');
?>
Return current item: Php simple acces data mysql