<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: CODE SNIPPETS?!</title>
		<link>https://legacy.forums.gravityhelp.com/topic/code-snippets</link>
		<description>Gravity Support Forums Topic: CODE SNIPPETS?!</description>
		<language>en-US</language>
		<pubDate>Sat, 25 Apr 2026 00:31:26 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/code-snippets" rel="self" type="application/rss+xml" />

		<item>
			<title>Joe on "CODE SNIPPETS?!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/code-snippets#post-5247</link>
			<pubDate>Tue, 04 May 2010 21:36:50 +0000</pubDate>
			<dc:creator>Joe</dc:creator>
			<guid isPermaLink="false">5247@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for that snippet, it could come in very useful :o)&#60;/p&#62;
&#60;p&#62;If the admin here have their hands full with programming, I'd be happy to write something up.  I admit that I am better known for writing horror, but I've written about 15 wp theme user guides in the past (proper ones for StyleWP last year, not those 3 page guides with a paragraph on each page).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "CODE SNIPPETS?!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/code-snippets#post-5243</link>
			<pubDate>Tue, 04 May 2010 20:49:21 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">5243@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I agree. Better hook/API documentation is pretty high in our priority list. Hang in there! And thanks for the PayPal code snippet.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>net_mage on "CODE SNIPPETS?!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/code-snippets#post-5238</link>
			<pubDate>Tue, 04 May 2010 17:27:16 +0000</pubDate>
			<dc:creator>net_mage</dc:creator>
			<guid isPermaLink="false">5238@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;GF staff,&#60;/p&#62;
&#60;p&#62;I love this plugin and it has made my life a lot easier however it is very frustrating that there are code snippets floating all over the forums and the documentation page is very bare.  Is there any way you can make it a priority to organize your code snippets (which are extremely helpful to the non-programmers) in a wiki or on the documentation page?  Otherwise its almost impossible for beginners to use all of the amazing options without examples.  Thanks guys.&#60;/p&#62;
&#60;p&#62;For instance this code snippet relating to post form submission:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission&#38;quot;, &#38;quot;post_to_paypal&#38;quot;, 10, 2);

function post_to_paypal($entry, $form){
    if($form[&#38;quot;id&#38;quot;] != 3) //NOTE: replace 3 with your form id
        return;
    ?&#38;gt;
        &#38;lt;form method=&#38;quot;post&#38;quot; action=&#38;quot;http://paypalURL&#38;quot; name=&#38;quot;form_to_paypal&#38;quot; id=&#38;quot;form_to_paypal&#38;quot;&#38;gt;
            &#38;lt;input type=&#38;quot;hidden&#38;quot; name=&#38;quot;name&#38;quot; value=&#38;quot;&#38;lt;?php echo $entry[&#38;quot;1&#38;quot;] ?&#38;gt;&#38;quot; /&#38;gt;
            &#38;lt;input type=&#38;quot;hidden&#38;quot; name=&#38;quot;email&#38;quot; value=&#38;quot;&#38;lt;?php echo $entry[&#38;quot;2&#38;quot;] ?&#38;gt;&#38;quot; /&#38;gt;
            &#38;lt;input type=&#38;quot;hidden&#38;quot; name=&#38;quot;phone&#38;quot; value=&#38;quot;&#38;lt;?php echo $entry[&#38;quot;3&#38;quot;] ?&#38;gt;&#38;quot; /&#38;gt;
            NOTE: $entry[&#38;quot;1&#38;quot;] will return field with ID=1. You can view the field ID by inspecting that input&#38;#39;s markup
            .... add your other fields here

        &#38;lt;/form&#38;gt;
        &#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
            document.getElementById(&#38;quot;form_to_paypal&#38;quot;).submit();
        &#38;lt;/script&#38;gt;
    &#38;lt;?php
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This could temporarily solve the PayPal dilemma a lot of people are having so long as they don't need ipn.  Just my two cents.  &#60;/p&#62;
&#60;p&#62;Oh this is the default paypal submission form.  Just tailor the form above to include the values you need/want.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;FORM ACTION=&#38;quot;https://www.paypal.com/cgi-bin/webscr&#38;quot; METHOD=&#38;quot;POST&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;cmd&#38;quot; VALUE=&#38;quot;_xclick&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;business&#38;quot; VALUE=&#38;quot;recipient@paypal.com&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;undefined_quantity&#38;quot; VALUE=&#38;quot;1&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;item_name&#38;quot; VALUE=&#38;quot;hat&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;item_number&#38;quot; VALUE=&#38;quot;123&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;amount&#38;quot; VALUE=&#38;quot;15.00&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;shipping&#38;quot; VALUE=&#38;quot;1.00&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;shipping2&#38;quot; VALUE=&#38;quot;0.50&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;currency_code&#38;quot; VALUE=&#38;quot;USD&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;first_name&#38;quot; VALUE=&#38;quot;John&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;last_name&#38;quot; VALUE=&#38;quot;Doe&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;address1&#38;quot; VALUE=&#38;quot;9 Elm Street&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;address2&#38;quot; VALUE=&#38;quot;Apt 5&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;city&#38;quot; VALUE=&#38;quot;Berwyn&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;state&#38;quot; VALUE=&#38;quot;PA&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;zip&#38;quot; VALUE=&#38;quot;19312&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;lc&#38;quot; VALUE=&#38;quot;US&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;email&#38;quot; VALUE=&#38;quot;buyer@domain.com&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;night_phone_a&#38;quot; VALUE=&#38;quot;610&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;night_phone_b&#38;quot; VALUE=&#38;quot;555&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;hidden&#38;quot; NAME=&#38;quot;night_phone_c&#38;quot; VALUE=&#38;quot;1234&#38;quot;&#38;gt;
&#38;lt;INPUT TYPE=&#38;quot;image&#38;quot; NAME=&#38;quot;submit&#38;quot; BORDER=&#38;quot;0&#38;quot; SRC=&#38;quot;http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif&#38;quot; ALT=&#38;quot;PayPal - The safer, easier way to pay online&#38;quot;&#38;gt;
&#38;lt;img alt=&#38;quot;&#38;quot; border=&#38;quot;&#38;quot; width=&#38;quot;1&#38;quot; height=&#38;quot;1&#38;quot; src=&#38;quot;https://www.paypal.com/en_US/i/scr/pixel.gif&#38;quot;&#38;gt;
&#38;lt;/FORM&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;All you paypal people out there.  Enjoy.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
