Pass variable when menu item is selected |
6/17/2022 1:17:00 AM |
PHPRunner General questions | |
A
asawyer13 authorDevClub member
Is it possible to set a session variable or pass a value to the application that's being called from a menu? When the user clicks on my Report Values page, I want to be able to pass some information to the page so it can be a bit dynamic. Thanks |
|
![]() |
mbintex 6/17/2022 |
just as ideas:
|
A
|
asawyer13 authorDevClub member 6/17/2022 |
Thanks, First one would work, but a bit messier in that I'd had a lot of report pages, but it would work. I don't know how the before process would work as I still would need to trap the menu press. The ? is a possibilty also, so I will think about that one. The session variable would be perfect but if I can't trap the menu press process I don't think I can do that. Alan |
![]() |
mbintex 6/17/2022 |
I don“t know if you can really catch the menu click event, but since all menus call some kind of page, you can kind of catch the menu call by the "before process event" of the target page. If menu "address" is called, the page "address" will tell you as soon as it starts to load. |
![]() |
Sergey Kornilov admin 6/18/2022 |
Passing the variable via URL is the simplest option here like myreport_report.php?myvar=somevalue Later you can use any of that report page events to read that value as $_GET["myvar"] |