How to put a specific variable in Session

0

Everyone, first hello !! I'm with a doubt,

I need to put a variable with the URL of the specific page in Session, so that it can be used on several pages later. The code that I'm using to get URl is this

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

But I could not put it in Session without changing it on subsequent pages. Could someone give me a light, how should I proceed?

    
asked by anonymous 30.03.2018 / 18:45

1 answer

-1

Try to make a constant:

session_start();

define("nome", "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");

$_SESSION['url'] = nome;
    
30.03.2018 / 18:58