Merge pull request #219 from Focuslinkstech/master
add dynamic Application URL
This commit is contained in:
commit
29db5cd139
@ -4,6 +4,23 @@ $db_port = ""; # Database Port. Keep it blank if you are un sure.
|
|||||||
$db_user = "root"; # Database Username
|
$db_user = "root"; # Database Username
|
||||||
$db_password = ""; # Database Password
|
$db_password = ""; # Database Password
|
||||||
$db_name = "phpnuxbill"; # Database Name
|
$db_name = "phpnuxbill"; # Database Name
|
||||||
define('APP_URL', 'http://localhost/phpnuxbill'); # Application URL.
|
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
||||||
|
$host = $_SERVER['HTTP_HOST'];
|
||||||
|
$baseDir = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
|
||||||
|
define('APP_URL', $protocol . $host . $baseDir);
|
||||||
#Please include http and do not use trailing slash after the url. For example use in this format- http://www.example.com Or http://www.example.com/finance
|
#Please include http and do not use trailing slash after the url. For example use in this format- http://www.example.com Or http://www.example.com/finance
|
||||||
$_app_stage = 'Live'; # Do not change this
|
$_app_stage = 'Live'; # Do not change this
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//error reporting
|
||||||
|
if($_app_stage!='Live'){
|
||||||
|
error_reporting(E_ERROR);
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
ini_set('display_startup_errors', 1);
|
||||||
|
}else{
|
||||||
|
error_reporting(E_ERROR);
|
||||||
|
ini_set('display_errors', 0);
|
||||||
|
ini_set('display_startup_errors', 0);
|
||||||
|
}
|
||||||
|
@ -28,7 +28,11 @@ if ($cn == '1') {
|
|||||||
if (isset($_POST['radius']) && $_POST['radius'] == 'yes') {
|
if (isset($_POST['radius']) && $_POST['radius'] == 'yes') {
|
||||||
$input = '<?php
|
$input = '<?php
|
||||||
|
|
||||||
define(\'APP_URL\', \'' . $appurl . '\');
|
$protocol = (!empty($_SERVER[\'HTTPS\']) && $_SERVER[\'HTTPS\'] !== \'off\' || $_SERVER[\'SERVER_PORT\'] == 443) ? "https://" : "http://";
|
||||||
|
$host = $_SERVER[\'HTTP_HOST\'];
|
||||||
|
$baseDir = rtrim(dirname($_SERVER[\'SCRIPT_NAME\']), \'/\\\');
|
||||||
|
define(\'APP_URL\', $protocol . $host . $baseDir);
|
||||||
|
|
||||||
$_app_stage = \'Live\';
|
$_app_stage = \'Live\';
|
||||||
|
|
||||||
// Database PHPNuxBill
|
// Database PHPNuxBill
|
||||||
@ -56,7 +60,11 @@ if($_app_stage!=\'Live\'){
|
|||||||
} else {
|
} else {
|
||||||
$input = '<?php
|
$input = '<?php
|
||||||
|
|
||||||
define(\'APP_URL\', \'' . $appurl . '\');
|
$protocol = (!empty($_SERVER[\'HTTPS\']) && $_SERVER[\'HTTPS\'] !== \'off\' || $_SERVER[\'SERVER_PORT\'] == 443) ? "https://" : "http://";
|
||||||
|
$host = $_SERVER[\'HTTP_HOST\'];
|
||||||
|
$baseDir = rtrim(dirname($_SERVER[\'SCRIPT_NAME\']), \'/\\\');
|
||||||
|
define(\'APP_URL\', $protocol . $host . $baseDir);
|
||||||
|
|
||||||
$_app_stage = \'Live\';
|
$_app_stage = \'Live\';
|
||||||
|
|
||||||
// Database PHPNuxBill
|
// Database PHPNuxBill
|
||||||
|
Loading…
x
Reference in New Issue
Block a user