This topic is locked

Pass record parameters to new page

10/12/2009 2:27:38 PM
PHPRunner General questions
P
Phil_G author

Hello

I am trying to do something similar to

THIS,

with the difference that I need a button on each line (for each record) that will pass details from the selected record to the new page.

I know how to add a button to each record using the code snippet, and I know how to save data in session variables and pass them, but how do I access record-specific data to save in session variables, baring in mind that no change is made on the original records (so no access to beforeupdate etc., and I can't use child-master relationships easily here.

Hope this makes sense

Philippe

D
danaci 10/12/2009

create this button

<INPUT class=button onclick="frmAdmin.a.value='pasparameter'; frmAdmin.submit(); return false;" type=button value="Pass parameter">
List page: Before delete event on the Events tab only.
if(@$_REQUEST["a"]=="pasparameter")

{

$param=explode("=",where);

header(location: your_table.php?yourparameter=$param[1]);

exit;

}

P
Phil_G author 10/12/2009

thanks for the quick response!

Would this not work only if I try to delete a record?



create this button

<INPUT class=button onclick="frmAdmin.a.value='pasparameter'; frmAdmin.submit(); return false;" type=button value="Pass parameter">
List page: Before delete event on the Events tab only.
if(@$_REQUEST["a"]=="pasparameter")

{

$param=explode("=",where);

header(location: your_table.php?yourparameter=$param[1]);

exit;

}

P
Phil_G author 10/12/2009

OK if I understand correctly this is one way of passing a value to another page but the problem I have is accessing the values for the current record in the list, not passing the values.



thanks for the quick response!

Would this not work only if I try to delete a record?

P
Phil_G author 10/12/2009

OK I think I have a solution, tho' I haven't actually tried it yet, but it works as far as creating a button and opening up a page:

  1. Create a dummy field on the SQL page ("SELECT 'Link' as Link" for example)
  2. on the editor page select the dummy field and VIEW AS 'Custom'
  3. $value = ... button code with access to variables...
    voila!
    The dummy field is because otherwise whichever 'real' field you choose ends up also as a button, even if it appears twice on the report.
    I'll try it out properly tomorrow.


    Hello

    I am trying to do something similar to

    THIS,

    with the difference that I need a button on each line (for each record) that will pass details from the selected record to the new page.

    I know how to add a button to each record using the code snippet, and I know how to save data in session variables and pass them, but how do I access record-specific data to save in session variables, baring in mind that no change is made on the original records (so no access to beforeupdate etc., and I can't use child-master relationships easily here.

    Hope this makes sense

    Philippe