PHP Classes

File: functions.php

Recommend this page to a friend!
  Classes of Okanlawon Anuoluwapo   Simple PHP AJAX Load Page Without Refresh   functions.php   Download  
File: functions.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Simple PHP AJAX Load Page Without Refresh
Load pages faster dynamically using AJAX requests
Author: By
Last change:
Date: 7 months ago
Size: 570 bytes
 

Contents

Class file image Download
<?php
function ssl() {
    if ( isset(
$_SERVER['HTTPS']) &&
    (
$_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
    &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {
       
$ssl = 'https';
    } else {
       
$ssl = 'http';
    }

    return
$ssl;
}


function
appUrl() {
   
$ssl = ssl();
    return (
$ssl)
          .
"://".$_SERVER['HTTP_HOST']
          . (
dirname($_SERVER["SCRIPT_NAME"]) == DIRECTORY_SEPARATOR ? "" : "/")
          .
trim(str_replace("\\", "/", dirname($_SERVER["SCRIPT_NAME"])), "/");
}