write a php script, to check whether the page is called from 'https://spellbox.app/spells/php or 'https://spellbox.app/spells/php in PHP

PHP
x
16
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')
$link = "https";
else
$link = "http";
// Here append the common URL characters.
$link .= "://";
// Append the host(domain name, ip) to the URL.
$link .= $_SERVER['HTTP_HOST'];
// Append the requested resource location to the URL
$link .= $_SERVER['REQUEST_URI'];
echo $link;
🤖 Code Explanation
This code displays the current URL of the page being viewed.

More problems solved in PHP




















