-3

How do I get, from which page/url the data in the $_POST variable come from :$_SERVER['HTTP_HOST'] ?

Elementary
  • 1,443
  • 1
  • 7
  • 17
  • 1
    Possible duplicate of https://stackoverflow.com/questions/6768793/get-the-full-url-in-php – misorude Aug 28 '18 at 10:55
  • 1
    Possible duplicate of [Get the full URL in PHP](https://stackoverflow.com/questions/6768793/get-the-full-url-in-php) – AmmoPT Aug 28 '18 at 11:28
  • Possible duplicate of [PHP HTTP Referrer](https://stackoverflow.com/questions/5307070/php-http-referrer) – Nico Haase Aug 28 '18 at 11:46

2 Answers2

0

You must use

$_SERVER['HTTP_REFERER']
Elementary
  • 1,443
  • 1
  • 7
  • 17
-1

The super-global $_SERVER could be useful for you, specifically $_SERVER['REQUEST_URI']:

        echo '<pre>';
        print_r($_SERVER);

//    [DOCUMENT_ROOT] => 
//    [REMOTE_ADDR] => 
//    [REMOTE_PORT] => 
//    [SERVER_SOFTWARE] => 
//    [SERVER_PROTOCOL] => 
//    [SERVER_NAME] => 
//    [SERVER_PORT] => 
//    [REQUEST_URI] => /f1 <-----------------
//    ...    
Emeeus
  • 5,072
  • 2
  • 25
  • 37
TsV
  • 629
  • 4
  • 7