PHP Classes

File: php/getCurrentPageUrl.php

Recommend this page to a friend!
  Classes of bamigboye biodun   Logical Functions   php/getCurrentPageUrl.php   Download  
File: php/getCurrentPageUrl.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Logical Functions
General-purpose PHP and JavaScript functions
Author: By
Last change:
Date: 1 year ago
Size: 519 bytes
 

Contents

Class file image Download
<?php
       
function getCurrentPageUrl(){
       
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://';
        return
$protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
        }

  
/*

Author : Biodun Bamigboye(biodunbamigboye@eportalnet.com)
Lead Developer at Eportal Net(eportalnet.com)
This function can easily retrieve browser the url of the current page.
Majorly useful in traditional websites.
Error log in api.
and any other relevant use cases

   */