I want to get the hostname and then set it to a variable.
Use case:
The email to reset the password is something like www.hostname1.com/?email=bla@bla.com&hash=xyz
I want to change it to a variable, so when I publish to another target it still works:
www.hostname200.com/?email=bla@bla.com&hash=xyz
I’m attempting to put them in the Globals in a server action and then put that server action on the page, but I don’t understand how the Globals work. (trying to do something similar to this guide)
The globals can be different depending on the web server and language used.
$_GET are variables from the querystring $_POST are variables from a form post $_PARAM are variables from the route parameters $_SESSION are variables from your server session storage $_SERVER are variables from your web server $_ENV are variables from the server enviroment (OS) $_COOKIE are variables from cookies $_ERROR is keeping the last error object
For the hostname you would probably need to use $_SERVER.
Referring to the screenshot above: is this the correct way to grab that global variable and put it in a server action? By simply creating a Variable under Globals → $_Server