Retrieve typed URL

1

I have a system that uses Session that expires with inactivity. Access to files on the system is only released after the session is opened. So far, beauty, it's working. I would like to memorize the link that was typed in the browser URL (address bar) for example link . I made a code here, but it does not return me to the expected result. Returns to the "public" folder. You would have to store in the variable $ url_browser, the exact string of the address bar. Follow the code.

 $url_browser = $_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"];
 //aqui executa o processo de login...
 header('Location: ' . $url_browser);
    
asked by anonymous 25.10.2016 / 17:59

2 answers

4

You can try:

 $url_browser = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
 //aqui executa o processo de login...
 header('Location: ' .$url_browser);
    
25.10.2016 / 18:21
1

Arrow in a variable like this:

$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

Documentation: link

    
25.10.2016 / 18:21