if (isset($_SERVER) && isset($_SERVER['SERVER_NAME'])) {
$base = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
$this->baseurl = @trim($base .$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/');
if (isset($_SERVER) && isset($_SERVER['SERVER_NAME'])) {
$base = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
$this->baseurl = @trim($base .$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/');