PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Send all post variables to page

  1. iamcanadian1973
    Member

    Is there a way to bypass the query string/redirect option, and just post to another page?
    I would like to post to a page outside WordPress (well doesn't really matter) and populate a hidden form that I'll be auto submitting to a payment gateway. It has to be a psot thta I send to them.

    Posted 12 years ago on Friday September 2, 2011 | Permalink
  2. You can use the gform_post_submission hook to send data wherever you like after the entry is accepted.

    This action hook is executed at the end of the submission process (after form validation, notification, and entry creation). Use this hook to perform actions after the entry has been created (i.e. feed data to third party applications). The Entry Object is available to this hook and contains all submitted values

    Posted 12 years ago on Friday September 2, 2011 | Permalink
  3. iamcanadian1973
    Member

    Thanks.

    I'm doing just that, but can't grab the first and last name fiel values. They have odd indexes.

    add_action("gform_post_submission", "set_post_content", 10, 2);
    function set_post_content($entry, $form){
    
        var_dump($entry);
    
    	$first_name = $entry['9.3'];
    	$last_name = $entry['9.6'];
    	$quantity = $entry['7'];
    	$product_code = $entry['3'];
    	$description = 'Vehicle Sticker';
    	$test = '{TESTD}';
    	// Price::Qty::Code::Description::Flags
    	// 9.99::1:: 001::T-Shirt::{TEST}{TESTD}{RB}
    	$products = $quantity  .'::' . $product_code  . '::' . $description . '::' . $test  ;
    	$address = $entry['15'];
    	$city = $entry['20'];
    	$state = $entry['16'];
    	$zip = $entry['34'];
    	$email = $entry['18'];
    	$phone = $entry['17'];
    
    	?>
    	<FORM name="MyForm" action="https://secure.internetsecure.com/process.cgi" method=post">
    	<input type=hidden name="GatewayID" value="15283">
    	<input type=hidden name="language" value="English">
    	<input type=hidden name="ReturnURL" value="http://www.autospy.org/EndofRegistration">
    	<input type=hidden name="xxxCancelURL" value="http://www.autospy.org/contact">
    	<input type=hidden name="Products" value="<?php echo $products; ?>">
    	<input type="hidden" name="xxxName" value="<?php echo $first_name; ?>  <?php echo $first_name; ?>">
    	<input type="hidden" name="xxxAddress" value="<?php echo $address; ?>">
    	<input type="hidden" name="xxxCity" value="<?php echo $city; ?>">
    	<input type="hidden" name="xxxState" value="<?php echo $state; ?>">
    	<input type="hidden" name="xxxZipCode" value="<?php echo $zip; ?>">
    	<input type="hidden" name="xxxEmail" value="<?php echo $email; ?>">
    	<input type="hidden" name="xxxPhone" value="<?php echo $phone; ?>"> 
    
    </FORM>	
    
    <SCRIPT LANGUAGE="JavaScript">
    
      //document.MyForm.submit();
    </SCRIPT>
    <?php
    
    }
    Posted 12 years ago on Friday September 2, 2011 | Permalink
  4. Are first and last names the only things missing? Everything else comes through OK?

    Also, can you post your var_dump($entry); ? If it's huge, please use pastie.org or pastebin.com

    Thanks

    Posted 12 years ago on Friday September 2, 2011 | Permalink