Pass info from page link to form
I thought it easier if I just mark up the code a bit, I've tried to notate where I made changes.  Can you run this and tell us what it does, if it doesn't solve your problem?

&lt;?php

  /**
   * @file
   * definition of uc-bitcoin-account-outgoing-escrows.tpl.php.
   */

  /** clr use $account instead of $user in case global $user is already in scope **/
  $account = user_load($variables['uid']);
  /* also, loading the user seems extraneous if you're not checking
   * anything else (is user valid, is user in a certain role, etc.)
   * if so, you should include an additional check.  If not, just
   *  do your query using $variables['uid']
   */
  global $base_url;

  /** clr drupalized the query **/
  $transactions = db_query("SELECT * FROM {uc_btc_escrow_payment} WHERE from_account=:user_id", array(':user_id' =&gt; $account-&gt;uid));

  $header = array(t('Escrow ID'), t('Amount'), t('Payment'), t('Allocated to'), t('Release'), t('Dispiute'), t('Date'));

  $rows = array();

  /** clr adding a check here **/
  if (!$transactions) {
    die('No Transactions were found');
  }
  /** clr clean up the anchor tags **/
  foreach ($transactions as $transaction) {
    $release_href = $base_url . '/user/orders/release-escrow/' . $transaction-&gt;escrow_id;
    $dispute_href = $base_url . '/user/funds/dispute-escrow/' . $transaction-&gt;escrow_id;
  $rows[] = array(
    $transaction-&gt;escrow_id, 
    $transaction-&gt;amount, $transaction-&gt;status , $transaction-&gt;to_user, 
    l('Release Payment', $release_href),
    l('Dispute Payment', $dispute_href),
    date('d/m/Y   g:i:s A', $transaction-&gt;created)
  );
}

print t('&lt;h2&gt;Outgoing Escrows&lt;/h2&gt;');

print theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows));
?&gt;


And then your function:

function uc_escrow_release_payment($form, &amp;$form_state, $escrow_id) {

/** check $escrow_id **/
if (!$escrow_id || $escrow_id == '') {
  die('Do something here, because you don\'t have everything you need');
}

/** clr not sure why '$' is used in $form key? */
$form['#$escrow_id'] = $escrow_id;

/** clr changed to fetch object **/
$transaction = db_query("SELECT * FROM {uc_btc_escrow_payment} WHERE escrow_id=:escrow_id", array(':escrow_id' =&gt; $escrow_id))-&gt;fetchObject();
/** check transaction **/
if (!$transaction) {
  die('No transaction was found; In ' . __FUNCTION__);
}
/** clr don't use $user for same reason above **/
$account = user_load($transaction-&gt;reference);
$to_user = $transaction-&gt;to_user;
/** check_plain() is only necessary when you're dealing with user supplied text. 
 *  that being said, I guess it never hurt to be over cautios */
return confirm_form($form, check_plain('Release Escrow Payment?'), 'user/orders', check_plain('Are you sure you want to release this payment and send the funds to ' . $to_user . '?'), check_plain('Yes'));
}