Get full url from address bar in php

Get the full webpage address from your address bar

 function get_url(){
 $p=$_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
 $f=$p.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
 return $f;
 }


Call Function
echo get_url();
Get full url from address bar in php Get full url from address bar in php Reviewed by JS Pixels on July 10, 2012 Rating: 5

1 comment:

  1. thanks for your tutorial, but how can i make breadcrumb with this function??

    ReplyDelete

Altaf Web. Powered by Blogger.