Get Page Url Php

[Solved] Get Page Url Php | Php - Code Explorer | yomemimo.com
Question : Get Current Page URL in PHP

Answered by : cl

<?php
$uri = $_SERVER['REQUEST_URI'];
echo $uri; // Outputs: URI
$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
echo $url; // Outputs: Full URL
$query = $_SERVER['QUERY_STRING'];
echo $query; // Outputs: Query String
?>

Source : https://www.thiscodeworks.com/61037852e9b6cc0014b683c9 | Last Update : Fri, 06 Aug 21

Question : get url php

Answered by : nachooch

$url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

Source : | Last Update : Fri, 24 Dec 21

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 : get url with php

Answered by : smiling-stag-q76h4g0shzen

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

Source : https://stackoverflow.com/questions/6768793/get-the-full-url-in-php | Last Update : Wed, 09 Dec 20

Question : get url link in php

Answered by : adrien-dumas

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

Source : | Last Update : Tue, 26 Jan 21

Answers related to get page url php

Code Explorer Popular Question For Php