Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to get the link of the current page in php

<?php  
    if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')   
         $url = "https://";   
    else  
         $url = "http://";   
    // Append the host(domain name, ip) to the URL.   
    $url.= $_SERVER['HTTP_HOST'];   
    
    // Append the requested resource location to the URL   
    $url.= $_SERVER['REQUEST_URI'];    
      
    echo $url;  
  ?> 
Comment

current page link using php

$actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
echo $actual_link ;
Comment

php current page url

$protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https';
$host     = $_SERVER['HTTP_HOST'];
$script   = $_SERVER['SCRIPT_NAME'];
$params   = $_SERVER['QUERY_STRING'];
 
$currentUrl = $protocol . '://' . $host . $script . '?' . $params;
 
echo $currentUrl;
Comment

get url link in php

actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
Comment

current page link using php

$url=$_SERVER['REQUEST_URI'];
echo $url;
Comment

PREVIOUS NEXT
Code Example
Php :: php default timezone 
Php :: Check duplicate email using Jquery validation in laravel 
Php :: remove register route in laravel 
Php :: laravel get last 5 records 
Php :: wordpress define constant if not defined 
Php :: php alert 
Php :: Hide all updates from WordPress 
Php :: laravel check method is post 
Php :: wordpress custom fields variable dump 
Php :: blade switch 
Php :: laravel route list only api 
Php :: run php server mac 
Php :: datetime format laravel 
Php :: for loop php increment by 2 
Php :: is php still used 
Php :: laravel where between cluse 
Php :: laravel now date 
Php :: php append file 
Php :: phoenix input type password 
Php :: how to fetch all defined constant in php 
Php :: create custom domain in localhost xampp 
Php :: laravel cashier overwrite users table name 
Php :: php date format 
Php :: NUMBER ONLY IN PHP 
Php :: psicopata narcisista 
Php :: php remove query param from url 
Php :: phpmyadmin max upload 
Php :: how to check the size of mysql database in phpmyadmin 
Php :: laravel artisan progress bar 
Php :: php remove last character from string if comma 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =