public function entryPost($identifier, $postArray = '') { $wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain); if (!$postArray) { $postArray = array('Field1' => 'Booyah!'); } return $wrapper->entryPost($identifier, $postArray); }
public function entryPost($identifier, $postArray = '') { $wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain); $postArray = array(new WufooSubmitField('Field1', 'Booyah!'), new WufooSubmitField('Field1', '/files/myFile.txt', $isFile = true)); return $wrapper->entryPost($identifier, $postArray); }
<?php require_once 'includes/WufooApiWrapper.php'; $apiKey = 'xxxx-xxxx-xxxx-xxxx'; //Enter here your Wufoo API $subdomain = 'example'; //Enter here your subdomain(group name) $identifier = 'xxxxxxxxxxxxx'; //Enter here your form id (Hash) $wrapper = new WufooApiWrapper($apiKey, $subdomain); $wufooSubmitFields = [new WufooSubmitField('Field3', $fname), new WufooSubmitField('Field4', $lname), new WufooSubmitField('Field7', $branch), new WufooSubmitField('Field150', $addressOne), new WufooSubmitField('Field151', $addressTwo), new WufooSubmitField('Field152', $city), new WufooSubmitField('Field153', $state), new WufooSubmitField('Field154', $zip), new WufooSubmitField('Field155', $country)]; /***************** from here manage you *************/ $wrapper->entryPost($identifier, $wufooSubmitFields); //or $wrapper->getForms($identifier); //or $wrapper->getFields($identifier); //or $wrapper->getEntries($identifier); //or $wrapper->getEntryCount($identifier); //and so on, see README.md file
<?php require_once 'wufoo/WufooApiWrapper.php'; $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $api_key = 'V74Z-27TA-V3Q4-FTJO'; $form_hash = 'w1xgfito09xcmku'; $wufoo_id = 'louisat14th'; $api = new WufooApiWrapper($api_key, $wufoo_id); $postArray = array(new WufooSubmitField('Field1', $first_name), new WufooSubmitField('Field2', $last_name), new WufooSubmitField('Field3', $email)); $response = $api->entryPost($form_hash, $postArray); header('Content-Type: application/json'); exit(json_encode($response));
/** * Action hook to process forms from AJAX request * * @access public * @return void */ public function action_wp_ajax_wufoo_post() { //look up the index of the hash of the form we're processing $index = $this->get_hash_by_label($_POST["form_type"]); //sanitize the data using wufoo's helpers $data = $this->_wufoo_sanitize($_POST['fields']); //set the hash $hash = $this->_hashes[$index]; //create an API wrapper object $api = new WufooApiWrapper($this->_api_key, $this->_wufoo_id); //make the API call $response = $api->entryPost($hash, $data); //record the response in JSON header('Content-Type: application/json'); echo json_encode($response); wp_die(); }