Php Current Page

[Solved] Php Current Page | Php - Code Explorer | yomemimo.com
Question : how to get the link of the current page in php

Answered by : wild-weasel

<?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;  
  ?> 

Source : https://www.javatpoint.com/how-to-get-current-page-url-in-php | Last Update : Wed, 11 Mar 20

Question : get current page php

Answered by : clear-civet-6y9w5jsi1gkp

<?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; ?> 

Source : https://www.javatpoint.com/how-to-get-current-page-url-in-php | Last Update : Wed, 16 Dec 20

Question : php current page url

Answered by : vmxes

$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;

Source : https://phpf1.com/tutorial/get-current-page-url.html | Last Update : Thu, 24 Dec 20

Question : php current page

Answered by : said-hr

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

Source : | Last Update : Tue, 29 Mar 22

Answers related to php current page

Code Explorer Popular Question For Php