fix warning array key
fix Warning: Undefined array key "HTTP_HOST" fix Warning: Undefined array key "SERVER_PORT"
This commit is contained in:
parent
6ffa396b05
commit
5e310cba29
@ -1,10 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ||
|
||||||
$host = $_SERVER['HTTP_HOST'];
|
(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443)) ? "https://" : "http://";
|
||||||
|
|
||||||
|
// Check if HTTP_HOST is set, otherwise use a default value or SERVER_NAME
|
||||||
|
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost');
|
||||||
|
|
||||||
$baseDir = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
|
$baseDir = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
|
||||||
define('APP_URL', $protocol . $host . $baseDir);
|
define('APP_URL', $protocol . $host . $baseDir);
|
||||||
|
|
||||||
|
|
||||||
$_app_stage = 'Live'; # Do not change this
|
$_app_stage = 'Live'; # Do not change this
|
||||||
|
|
||||||
$db_host = "localhost"; # Database Host
|
$db_host = "localhost"; # Database Host
|
||||||
|
Loading…
x
Reference in New Issue
Block a user