I have got one page with four buttons and inside them, there is an onclick with a function that asks to the user whether he/she would like invoice or not. If he/she clicks on yes, it redirects to one page; if it is no, to another page.
What I would like to do is that when the user clicks on one of the four buttons, a variable called $price1, $price2, $price3 or $price4 (depending on the button clicked) is passed to the second page where it is printed using DOMPDF.
One savage solution would be creating four global variables ($price1, 2, ...) and four functions that redirect to four second pages and if it is page 1, DOMPDF uses global variable 1, if it is page 2, DOMPDF will use global variable 2 and so on.
Another solution would be creating the four functions with a javascript var that contains the value of the php ones and pass it to the second page. Then, in the second page, transform again the JS var to a php one and use it in DOMPDF.
Myy final one would be using cookies, but I have understood that they are not very secure, are they?
Which one do you believe would be better to implement? Can you think of another better one?
Thank you so much for your time.