12 lines
		
	
	
		
			282 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
		
		
			
		
	
	
			12 lines
		
	
	
		
			282 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
|  | <?php | ||
|  | function get_protocol() { | ||
|  | 	$protocol = "http"; | ||
|  | 	if ( (!empty($_SERVER['HTTPS'] && $_SERVER['HTTPS'] !== 'off') || | ||
|  | 		$_SERVER['SERVER_PORT'] == 443) ) | ||
|  | 		$protocol = "https"; | ||
|  | 	return $protocol."://"; | ||
|  | } | ||
|  | $protocol = get_protocol(); | ||
|  | $base_url = $protocol.$_SERVER['HTTP_HOST']; | ||
|  | ?>
 |