Consider the following html address:
http://exemplo.com/1/2/3/teste.php
I wanted to indicate in the variable $ender
the absolute address of my scripts (including them) to be found independent of the change of address (being in the root or subdirectory). I tried this "http://$_SERVER[HTTP_HOST]$SERVER[REQUEST_URI]"
to try to at least replace this: ( http://exemplo.com/1/2/3/
). Did not work. I wanted to avoid the literalness of everything ( http://exemplo.com/1/2/3/teste.php
). I just had some partial success with http: // $ _ SERVER [HTTP_HOST], but it only replaces the base address.
<?php
error_reporting(E_ALL);
$host = $_SERVER['HTTP_HOST']$SERVER['REQUEST_URI']/;
$id = $_GET['id'];
if ($id == 1) {