Good day professionals. I have a link, when you press it, the value is passed through the variable dep_link. Next, I use this value via GET

$_GET['dep_link'] 

Question: How can I once click a link to save this value for further processing, for example, a button? That is, the logic is this - at first I chose something by clicking on the link, and then I need to use the value of the link by clicking the button. After all, if I press the button, then I do not click the link :) and the value of the link is reset and nothing is equal. I myself can not cope with the problem.

  • Look from the side of the sessions or cookies, one saves the values ​​until the browser closes, the other over time. - Yaroslav Molchan

1 answer 1

You can put the data from $_GET['dep_link'] into $_SESSION['dep_link'] - this data will be available the next time the script is called. Or use the data from $_GET['dep_link'] to fill in hidden fields in the form, then when submitting the form, this data will go to the server along with the rest.