Get variable from url

Hello everybody.

I’ve checked the forum quite a bit and, although there are some related answers, I haven’t found anything that works for me in the applications I’m working on. I’m quite new to programming, because I think it should be a not too complicated issue.

I get several values in the url that opens the application (for example: http://127.0.0.1:8091/scriptcase/app/project/menu/menu.php?nmgp_outra_jan=true&nmgp_start=SC&6201&id=45&cc=60&nid=60).In this case, I get id, cc and nid. In different applications I need to use these values to fill in a form field or make queries.
The values seem to be received well in the application (they appear with echo $_GET[‘id’]; in the application that receives them -the main menu-); but, from then on, I can’t use them in any other application. When I try to use them in a query, for example, they stay as [‘id’] and give me continuous errors.I have also tried to convert them into global variables, but no result.

I have also tried the option $_SESSION[‘id’]; and I get the error Array to string conversion.
I appreciate your help.

jesús

Hi, just a suggestion:

[n_id] = $_GET[‘id’];

And try to use this variable in other application and see if this works or not.

2 Likes

Hi Kleyber:
It works. Thank you very much.
I have tried it in all other applications and it works in all of them.
Thanks for sharing your knowledge!!
jesus

1 Like