This topic is locked

Variable inside search url

8/27/2022 10:00:30 AM
PHPRunner Tips and Tricks
T
technoserv author

I put a button in the list and I would like it to show me the list with key id the results of another table.
The button passes the parameters correctly:

Server
$ record = $ button-> getCurrentRecord ();
$ result ["id_gear"] = $ record ["id_gear"];

Client After
var variable = result ["id_gear"];
ajax.setMessage (variable);

"variable" is correctly displayed.
But when I put it in the redirect link to the list it doesn't work.

Customer After
window.open (
'oil_and_filters_list.php? q = (id_gear ~ contains ~ (variable))',
'_blank');

The result is textual and not the value of the variable:

http: //localhost/autodb/output/oil_and_filters_list.php? q = (id_gear ~ contains ~ (variable))

I believe it is a syntax problem.
Can someone help me?

Sergey Kornilov admin 8/28/2022

You need to concatenate pieces of the URL together, you cannot just insert variable in there.

Check this article for inspiration:
https://masteringjs.io/tutorials/fundamentals/string-concat