<?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: Post Submission Trouble With Theme</title>
		<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme</link>
		<description>Gravity Support Forums Topic: Post Submission Trouble With Theme</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 03:26:05 +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/post-submission-trouble-with-theme" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-33054</link>
			<pubDate>Fri, 19 Aug 2011 15:59:08 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">33054@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Glad you got it worked out.  Thanks for the update.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>malnack on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-33039</link>
			<pubDate>Fri, 19 Aug 2011 14:54:11 +0000</pubDate>
			<dc:creator>malnack</dc:creator>
			<guid isPermaLink="false">33039@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks. That got me the rest of the way. Hats off for auto-incrementing the file upload name if it already existed. I was going to write something to handle that.&#60;/p&#62;
&#60;p&#62;Brent
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-33022</link>
			<pubDate>Fri, 19 Aug 2011 10:44:09 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">33022@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I think you can do line 13 in your non-working example differently.  Something like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
$sql=&#38;#39;INSERT INTO user_items (user, item) VALUES (&#38;#39; . $entry[&#38;#39;created_by&#38;#39;] .&#38;#39;,&#38;#39;. $entry[&#38;#39;2&#38;#39;]. &#38;#39;)&#38;#39;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Line 38 probably corresponds to line 13 as you pasted it here.&#60;/p&#62;
&#60;p&#62;Here's the nitty gritty on why that needs to be:&#60;br /&#62;
&#60;a href=&#34;http://php.net/manual/en/language.types.string.php#language.types.string.parsing&#34; rel=&#34;nofollow&#34;&#62;http://php.net/manual/en/language.types.string.php#language.types.string.parsing&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>malnack on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-33016</link>
			<pubDate>Fri, 19 Aug 2011 10:00:18 +0000</pubDate>
			<dc:creator>malnack</dc:creator>
			<guid isPermaLink="false">33016@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In my functions.php, this code executes successfully (I've hidden my database info):&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission_1&#38;quot;, &#38;quot;set_post_content&#38;quot;, 10, 2);
function set_post_content($entry, $form){
	define(&#38;quot;HOSTNAME&#38;quot;,&#38;quot;*****&#38;quot;);
	define(&#38;quot;USERNAME&#38;quot;,&#38;quot;*****&#38;quot;);
	define(&#38;quot;PASSWORD&#38;quot;,&#38;quot;*****&#38;quot;);
	define(&#38;quot;DATABASE&#38;quot;,&#38;quot;*****&#38;quot;);
	$con = mysql_connect(HOSTNAME, USERNAME, PASSWORD);
		if (!$con)
		{
			die(&#38;#39;Could not connect: &#38;#39; . mysql_error());
		}
		echo &#38;quot;do&#38;quot;;
		$sql=&#38;quot;INSERT INTO user_items (user, item) VALUES (&#38;#39;1&#38;#39;, &#38;#39;2&#38;#39;)&#38;quot;;
		if (!mysql_query($sql,$con))
		{
			die(&#38;#39;Error: &#38;#39; . mysql_error());
		}
		mysql_close($con);}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The form executes, my data gets entered, and my &#34;do&#34; is written to the form as expected. If I change the code to this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission_1&#38;quot;, &#38;quot;set_post_content&#38;quot;, 10, 2);
function set_post_content($entry, $form){
	define(&#38;quot;HOSTNAME&#38;quot;,&#38;quot;*****&#38;quot;);
	define(&#38;quot;USERNAME&#38;quot;,&#38;quot;*****&#38;quot;);
	define(&#38;quot;PASSWORD&#38;quot;,&#38;quot;*****&#38;quot;);
	define(&#38;quot;DATABASE&#38;quot;,&#38;quot;*****&#38;quot;);
	$con = mysql_connect(HOSTNAME, USERNAME, PASSWORD);
		if (!$con)
		{
			die(&#38;#39;Could not connect: &#38;#39; . mysql_error());
		}
		echo &#38;quot;do&#38;quot;;
		$sql=&#38;quot;INSERT INTO user_items (user, item) VALUES ($entry[&#38;#39;created_by&#38;#39;], $entry[&#38;#39;2&#38;#39;])&#38;quot;;
		if (!mysql_query($sql,$con))
		{
			die(&#38;#39;Error: &#38;#39; . mysql_error());
		}
		mysql_close($con);}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I get this error or a variation of it:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/63/6744963/html/wp-content/themes/CeCe3/functions.php on line 38&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;The line number of the error generaly doesn't point to anything meaningful.&#60;/p&#62;
&#60;p&#62;Let me know if you need more info.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-32992</link>
			<pubDate>Thu, 18 Aug 2011 23:08:54 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">32992@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Please post the actual code you're using in your functions.php.&#60;/p&#62;
&#60;p&#62;And can you share the error with us in its entirety?  It will help with debugging.  Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>malnack on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-32939</link>
			<pubDate>Thu, 18 Aug 2011 16:01:04 +0000</pubDate>
			<dc:creator>malnack</dc:creator>
			<guid isPermaLink="false">32939@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I don't think that is the issue. When I try to use any of the $entry values in my code, I get an error. I've tried to simplify it but it looks like when I reference the $entry, it blows out.&#60;/p&#62;
&#60;p&#62;At the moment I'm just trying to insert either the user $entry['created_by'] and/or a hidden form value $entry['1'] which would return the user name. Both of these values are to go into my custom table.&#60;/p&#62;
&#60;p&#62;Any thoughts?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-32933</link>
			<pubDate>Thu, 18 Aug 2011 15:52:19 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">32933@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Very strange.  So your code worked WITH Exec PHP activated but doesn't without it?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>malnack on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-32910</link>
			<pubDate>Thu, 18 Aug 2011 13:58:40 +0000</pubDate>
			<dc:creator>malnack</dc:creator>
			<guid isPermaLink="false">32910@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;One thing to note: Not sure it is related but part of my WP site uses Exec PHP. As part of my troubleshooting I had disabled it. Problem still existed and then I re-enabled it and my code started working.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>malnack on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-32906</link>
			<pubDate>Thu, 18 Aug 2011 13:37:20 +0000</pubDate>
			<dc:creator>malnack</dc:creator>
			<guid isPermaLink="false">32906@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Looks like I got beyond that issue. Thanks!&#60;/p&#62;
&#60;p&#62;Brent
&#60;/p&#62;</description>
		</item>
		<item>
			<title>malnack on "Post Submission Trouble With Theme"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-submission-trouble-with-theme#post-32882</link>
			<pubDate>Thu, 18 Aug 2011 10:33:07 +0000</pubDate>
			<dc:creator>malnack</dc:creator>
			<guid isPermaLink="false">32882@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm having trouble adding a post_submission to my functions.php in my theme. I thought it might be a conflict with the theme itself, but I've switched to a simple theme and am encountering a similar problem.&#60;/p&#62;
&#60;p&#62;I've created a single Gravity Form and when I add this to my functions.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission_1&#38;quot;, &#38;quot;set_post_content&#38;quot;, 10, 2);
function set_post_content($entry, $form){
//do nothing
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I get an error. I've tried moving it around in the functions.php file to no avail. Is there a full example of a functions.php file that I can examine?&#60;/p&#62;
&#60;p&#62;I'm using WP version 3.2.1 and GF 1.5.2.8.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;/p&#62;
&#60;p&#62;Brent
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
