PHP Classes

File: examples/url/URL.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/url/URL.php   Download  
File: examples/url/URL.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 405 bytes
 

Contents

Class file image Download
<?php

class URL {

    function
URL($script='') {
        if (
$_SERVER['HTTPS'] == 'on') {
           
$protocol = 'https';
        } else {
           
$protocol = 'http';
        }
       
$url = $protocol . '://' . $_SERVER['HTTP_HOST'];
        if (
$script) {
           
$url .= $script;
        } else {
           
$url .= $_SERVER['SCRIPT_NAME'];
            if (
$_SERVER['PATH_INFO']) {
               
$url .= $_SERVER['PATH_INFO'];
            }
        }
        return
$url;
    }

}

?>