This topic is locked

Passing Field Data through a Link

9/22/2007 7:25:20 PM
PHPRunner General questions
L
ldchristopher author

Hello,
I'm not sure I am saying the correctly, but I need a way to pass field data through a link.
In this case, I want to put a link next to each record in a list view. When someone clicks on the link next to a particular record, they would be taken to an add page for another table. When this happens, I would like for the ID of the record where the link was to be passed through and automatically populate a field on the add page when it opens.
Is this possible? Maybe through an action??
Thanks!!

A
alang 9/23/2007

The way I do this is:

  1. Set up a field as "custom" and generate a link with extra parameters added, eg:
    [codebox]$value = "<a href=order_add.php?&Sel=".$data["SR_Number"]."&Ddn=".$data["ID"]."&Prod=".$data["Serial_Number"].">".$data["Serial_Number"]."</a>";[/codebox]
    (Sel, Ddn, Prod are the custom parameters)
  2. In the destination page, pick out the custom parameters in an event (say before display on add page)

    [codebox]$smarty->assign("value_prodcode",$_REQUEST["Prod"]);[/codebox]