<?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: Run php code upon sumbission?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/run-php-code-upon-sumbission</link>
		<description>Gravity Support Forums Topic: Run php code upon sumbission?</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:32:18 +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/run-php-code-upon-sumbission" rel="self" type="application/rss+xml" />

		<item>
			<title>Sbyrakis on "Run php code upon sumbission?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/run-php-code-upon-sumbission#post-22924</link>
			<pubDate>Mon, 11 Apr 2011 03:43:38 +0000</pubDate>
			<dc:creator>Sbyrakis</dc:creator>
			<guid isPermaLink="false">22924@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, I fixed it, removed from the get_post_submit_info_to_activity function the global reference for $entry
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Sbyrakis on "Run php code upon sumbission?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/run-php-code-upon-sumbission#post-22889</link>
			<pubDate>Sun, 10 Apr 2011 04:27:34 +0000</pubDate>
			<dc:creator>Sbyrakis</dc:creator>
			<guid isPermaLink="false">22889@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Carl, &#60;/p&#62;
&#60;p&#62;I tried to implement the specific action, however it seems that it does not return the $entry object. As you see in the code below, I am iring the action (gform_post_submission) after the action (bp_artwork_submit_content) that actually submits the form.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function bp_artwork_submit() {
	global $bp; 

	do_action( &#38;#39;bp_artwork_submit&#38;#39; );
	add_action( &#38;#39;bp_template_title&#38;#39;, &#38;#39;bp_artwork_submit_title&#38;#39; );
	add_action( &#38;#39;bp_template_content&#38;#39;, &#38;#39;bp_artwork_submit_content&#38;#39; );
	add_action(&#38;#39;gform_post_submission&#38;#39;, &#38;#39;get_post_submit_info_to_activity&#38;#39;, 10, 2);
	bp_core_load_template( apply_filters( &#38;#39;bp_core_template_plugin&#38;#39;, &#38;#39;members/single/plugins&#38;#39; ) );
	}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The PHP code itself that should get the object is:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function get_post_submit_info_to_activity($entry, $form){
    global $bp, $entry;
	//getting post
	$post_submit_info = array(
		&#38;#39;action&#38;#39; =&#38;gt; &#38;#39;submitted an artwork&#38;#39;,
		&#38;#39;type&#38;#39; =&#38;gt; &#38;#39;artwork_submission&#38;#39;,
		&#38;#39;user_id&#38;#39; =&#38;gt; $bp-&#38;gt;loggedin_user-&#38;gt;id,
		);
	bp_artwork_record_activity($post_submit_info);
	}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The problem is that I can not get any values out of the $entry array. Can this be related to the redirection after posting the form?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Run php code upon sumbission?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/run-php-code-upon-sumbission#post-22782</link>
			<pubDate>Fri, 08 Apr 2011 11:27:02 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">22782@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can't call a PHP file the way you are probably thinking you'd like to do it.  You have to use a Gravity Forms API hook to then execute your custom PHP and do whatever you want with the form data.  This custom PHP would go in your themes functions.php file.&#60;/p&#62;
&#60;p&#62;You would use the gform_post_submission hook which has access to the entry object containing the form data.  You'd use this hook to execute your custom PHP to do whatever you want to do with the data.&#60;/p&#62;
&#60;p&#62;Here is a forum posts that discusses this:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/sms-api-gateway-need-help-to-get-gform-to-integrate#post-18087&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/sms-api-gateway-need-help-to-get-gform-to-integrate#post-18087&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The gform_post_submission hook is also documented in the Documentation in the Developer Docs area.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jn19 on "Run php code upon sumbission?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/run-php-code-upon-sumbission#post-22750</link>
			<pubDate>Thu, 07 Apr 2011 20:01:37 +0000</pubDate>
			<dc:creator>jn19</dc:creator>
			<guid isPermaLink="false">22750@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I need to know how to call a php file when the user clicks submit on a form. In this case the form is simply an email address field. I want to add the email address to a database automatically. I have the php code to do this, but I don't know how to get the submit button to call it.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
