Only start the session and create session variables when not running in CLI
This commit is contained in:
		
							parent
							
								
									498a031cab
								
							
						
					
					
						commit
						8a38d3ce9f
					
				| 
						 | 
				
			
			@ -9,6 +9,7 @@ require 'functions.php';
 | 
			
		|||
// be named "require_login() and take no parameters
 | 
			
		||||
require 'authfunctions.php';
 | 
			
		||||
 | 
			
		||||
if ( php_sapi_name() != "cli" ) {
 | 
			
		||||
    // Start the session
 | 
			
		||||
    session_name(SESSIONCOMICS);
 | 
			
		||||
    session_start();
 | 
			
		||||
| 
						 | 
				
			
			@ -45,6 +46,7 @@ if ( isset($_REQUEST['hash']) ) {
 | 
			
		|||
    if ( !isset($_SESSION['sortorder']) ) {
 | 
			
		||||
    $_SESSION['sortorder'] = SORTBYDATE;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Make our PDO database connection which will be used in all scripts
 | 
			
		||||
$globaldbh = new PDO("mysql:host=" . DBHOST . ";dbname=" . DBNAME, DBUSER, DBPASS);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user