note 128431 added to reserved.variables.server
| From: | FlorinC at main dot php dot net | Date: | Wed, 26 Apr 2023 06:52:36 +0000 |
| Subject: | note 128431 added to reserved.variables.server | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220386@lists.php.net to get a copy of this message | ||
<?php
//Working example tested with success in Debian Linux with Apache 2.4
$protocol=$_SERVER['PROTOCOL'] = isset($_SERVER['HTTPS']) &&
!empty($_SERVER['HTTPS']) ? 'https' : 'http'; //thanks to Mark Simon
@ https://www.php.net/manual/en/reserved.variables.server.php
$doc_root = $_SERVER['DOCUMENT_ROOT']; // e.g. /var/www/webabc/web/
$module_path = dirname(__FILE__); // e.g. /var/www/webabc/web/modules/verstion152/
$host = $_SERVER['HTTP_HOST']; // e.g. 192.168.1.4
$online_path = $protocol .'://'. $host . '/' . str_replace($doc_root,
'', $module_path);
echo "The online path is: " . $online_path;
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 81.147.118.148)
----
Manual Page -- https://php.net/manual/en/reserved.variables.server.php
Edit -- https://main.php.net/note/edit/128431
Del: integrated -- https://main.php.net/note/delete/128431/integrated
Del: useless -- https://main.php.net/note/delete/128431/useless
Del: bad code -- https://main.php.net/note/delete/128431/bad+code
Del: spam -- https://main.php.net/note/delete/128431/spam
Del: non-english -- https://main.php.net/note/delete/128431/non-english
Del: in docs -- https://main.php.net/note/delete/128431/in+docs
Del: other reasons-- https://main.php.net/note/delete/128431
Reject -- https://main.php.net/note/reject/128431
Search -- https://main.php.net/manage/user-notes.php