SHARE
TWEET

Untitled

a guest Dec 26th, 2012 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         add_filter("gform_field_value_singlelinetext", "populate_singlelinetext");
  2.         function populate_singlelinetext($value)
  3.         {
  4.  
  5.                 // Use the REQUESTED PHP variables to lookup the appropriate information
  6.                 global $wpdb;
  7.                 $form_data = $wpdb->get_results("SELECT * FROM wp_rg_lead_detail WHERE form_id = '".$_REQUEST['form_id']."' AND lead_id = '".$_REQUEST['entry_id']."'");
  8.  
  9.                 $my_count = 0;
  10.                 //Loop through array to pick out first name field of 1.3
  11.                 foreach($form_data["fields"] as &$field)
  12.                         if($field["field_number"] == '1.3')
  13.                         {            
  14.                                 $my_count++;
  15.                                 $my_field =$field['value'];
  16.                                
  17.                         }
  18.  
  19.             echo '<pre>'; print_r($form_data); echo '</pre>';
  20.         return $my_field;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top