<?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: gform condition statement?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/gform-condition-statement</link>
		<description>Gravity Support Forums Topic: gform condition statement?</description>
		<language>en-US</language>
		<pubDate>Mon, 06 Apr 2026 08:25:28 +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/gform-condition-statement" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "gform condition statement?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-condition-statement#post-15558</link>
			<pubDate>Thu, 06 Jan 2011 08:44:58 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">15558@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;&#60;code&#62;setcookie(&#38;quot;dh_country&#38;quot;, $entry[1], time() + 31536000, COOKIEPATH, COOKIE_DOMAIN, false, true);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Since the &#60;strong&#62;$entry&#60;/strong&#62; array already has the value available, you don't have to mess with the $_POST at all. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rovillesarate on "gform condition statement?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-condition-statement#post-15546</link>
			<pubDate>Thu, 06 Jan 2011 00:15:52 +0000</pubDate>
			<dc:creator>rovillesarate</dc:creator>
			<guid isPermaLink="false">15546@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi! Is this code correct?&#60;/p&#62;
&#60;p&#62;setcookie(&#34;dh_country&#34;, $_POST[$entry[1]], time() + 31536000, COOKIEPATH, COOKIE_DOMAIN, false, true);
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rovillesarate on "gform condition statement?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-condition-statement#post-15545</link>
			<pubDate>Thu, 06 Jan 2011 00:10:15 +0000</pubDate>
			<dc:creator>rovillesarate</dc:creator>
			<guid isPermaLink="false">15545@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Wow! Thanks. Will try the code. =D
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "gform condition statement?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-condition-statement#post-15543</link>
			<pubDate>Wed, 05 Jan 2011 23:48:52 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">15543@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Try something like this: &#60;a href=&#34;http://pastie.org/1433020&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1433020&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;A few things to note:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission_1&#38;quot;, &#38;quot;post_submission_cookie&#38;quot;, 10, 2);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The &#60;strong&#62;1&#60;/strong&#62; after &#60;strong&#62;gform_post_submission_&#60;/strong&#62; is the ID of the form you'd like to run the function on.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;$_POST[&#38;quot;input_&#38;quot; . $field[&#38;quot;1&#38;quot;]]&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The &#60;strong&#62;$entry&#60;/strong&#62; which is passed to the function by the hook array actually contains all the values submitted by the form so if you're trying to get the value of field ID 1, you can just use &#60;strong&#62;$entry[1]&#60;/strong&#62;.&#60;/p&#62;
&#60;p&#62;Hope this helps!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rovillesarate on "gform condition statement?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-condition-statement#post-15540</link>
			<pubDate>Wed, 05 Jan 2011 23:19:26 +0000</pubDate>
			<dc:creator>rovillesarate</dc:creator>
			<guid isPermaLink="false">15540@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Im trying to use this code but would like to insert a condition statement to prevent other forms from using this&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission&#38;quot;, &#38;quot;post_submission_cookie&#38;quot;);
function post_submission_cookie($entry){
// insert condition here to know if gform is equals to gform[id]
    setcookie(&#38;quot;dh_country&#38;quot;, $_POST[&#38;quot;input_&#38;quot; . $field[&#38;quot;1&#38;quot;]], time() + 31536000, COOKIEPATH, COOKIE_DOMAIN, false, true);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;}
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rovillesarate on "gform condition statement?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-condition-statement#post-15539</link>
			<pubDate>Wed, 05 Jan 2011 23:14:17 +0000</pubDate>
			<dc:creator>rovillesarate</dc:creator>
			<guid isPermaLink="false">15539@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi! What condition should i use to check if what gform is loaded?&#60;/p&#62;
&#60;p&#62;ex: if ( gform = gform1 ) { execute code }&#60;/p&#62;
&#60;p&#62;How do i do this? Im trying to submit a cookie value after post submission but i dont want all my forms to be affected by the function.&#60;/p&#62;
&#60;p&#62;Any Suggestions?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
