In PHP, how to get the full current URL with parameters?
In PHP, to get the full URL of the current page with parameters, the best option is to concatenate the following variables :
// Get the full URL with protocole and parameters
// As an example: https://www.example.com/page.html?param1=abc¶m2=123
$url = ( ($_SERVER['HTTPS'] ?? 'off' === 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
In PHP, to get the full URL of the current page with parameters, the best option is to concatenate the following variables :
// Get the full URL with protocole and parameters
// As an example: https://www.example.com/page.html?param1=abc¶m2=123
$url = ( ($_SERVER['HTTPS'] ?? 'off' === 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
In PHP, to get the full URL of the current page with parameters, the best option is to concatenate the following variables :
// Get the full URL with protocole and parameters
// As an example: https://www.example.com/page.html?param1=abc¶m2=123
$url = ( ($_SERVER['HTTPS'] ?? 'off' === 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
In PHP, to get the full URL of the current page with parameters, the best option is to concatenate
// Get the full URL with protocole and parameters
// As an example: https://www.example.com/page.html?param1=abc¶m2=123
$url = ( ($_SERVER['HTTPS'] ?? 'off' === 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
In PHP, to get the full URL of the current page with parameters, the best option is to concatenate
// Get the full URL with protocole and parameters
// As an example: https://www.example.com/page.html?param1=abc¶m2=123
$url = ( ($_SERVER['HTTPS'] ?? 'off' === 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
To get the full URL with parameters in PHP, the best option is to concatenate
// Get the full URL with protocole and parameters
$url = ( ($_SERVER['HTTPS'] ?? 'off' === 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
# | ID | Query | URL | Count |
---|---|---|---|---|
0 | 6817 | quel son les meilleurs site d'annonce allemend 2022 | https://en.ans.wiki/622/in-php-how-to-get-the-full-current-url-with-parameters | 1 |
1 | 5959 | Annonce en allemage | https://en.ans.wiki/622/in-php-how-to-get-the-full-current-url-with-parameters | 1 |