This topic is locked
[SOLVED]

view as custom

7/2/2024 2:12:17 PM
PHPRunner General questions
francesco author

I have a view as custom field that works correctly and generates a link that redirects me to table elencodoc_vista_list :

*$value = "<a href='" . $link . "'>" . $nomeop . "</a>";*

My request is to pass $nomeop = $data["nome"] as a variable to echo $nomeop within a code snippet in the table that I am opening (elencodoc_vista_list). I tried using a session variable but it didn't work. How can I proceed?
Thank you for your help.

img alt

C
Chris Whitehead 7/3/2024

If "nome" is the value in the field to start with, maybe try.

$value = "<a href='" . $link . "'>" . $value . "</a>";

francesco author 7/4/2024

I used a query string approach, which means adding key-value pairs to the URL of the link. These can then be extracted on the destination page using PHP with $nomeop = $_GET['nome'];

C
Chris Whitehead 7/4/2024

Are you wanting to send the filter in the link? Using "f" appears to work on mine as I have the filters on the page.

$opid = DB::DBLookup( "SELECT ID FROM operatore WHERE nome='$nomeop'" );
$param_data = array(
'nome' => $opid,
'f' => '(operatores-equals-' . $opid . ')'

);
$link = $serverAddress . '/output/elencodoc_vista_list.php?' . http_build_query( $param_data );