Advertisement
Guest User

Untitled

a guest
Dec 26th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement