<?xml version="1.0" encoding="UTF-8"?><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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to run custom PHP code in WordPress &#8211; the right way</title>
	<atom:link href="http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/</link>
	<description>thoughts on web development and design</description>
	<lastBuildDate>Thu, 26 May 2011 13:12:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Andy</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-319</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Thu, 26 May 2011 04:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-319</guid>
		<description>I guess this is a question for everyone in this comment thread, but how does this method of including php via ABSPATH in the main template file compare to making custom templates for pages with php functions? I&#039;m just wondering if one method will result in better end-user experience compared to other.</description>
		<content:encoded><![CDATA[<p>I guess this is a question for everyone in this comment thread, but how does this method of including php via ABSPATH in the main template file compare to making custom templates for pages with php functions? I&#8217;m just wondering if one method will result in better end-user experience compared to other.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-316</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Sat, 21 May 2011 08:32:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-316</guid>
		<description>Great job! I have been seraching for this, thanks.</description>
		<content:encoded><![CDATA[<p>Great job! I have been seraching for this, thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vikram Kothari</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-312</link>
		<dc:creator>Vikram Kothari</dc:creator>
		<pubDate>Thu, 05 May 2011 19:10:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-312</guid>
		<description>You are very right about eval being ineffective. But I am not sure how just moving the code to a separate file will solve the issue? From the manual, the include statement also evaluates the content of file.</description>
		<content:encoded><![CDATA[<p>You are very right about eval being ineffective. But I am not sure how just moving the code to a separate file will solve the issue? From the manual, the include statement also evaluates the content of file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-309</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Sun, 01 May 2011 15:38:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-309</guid>
		<description>great finally I found the correct way to include my file :-)</description>
		<content:encoded><![CDATA[<p>great finally I found the correct way to include my file :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Judd Exley</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-305</link>
		<dc:creator>Judd Exley</dc:creator>
		<pubDate>Fri, 01 Apr 2011 06:55:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-305</guid>
		<description>Mate, you&#039;re BRILLIANT.  You just saved me about 2 hours of Googling and swearing.

Thank you!</description>
		<content:encoded><![CDATA[<p>Mate, you&#8217;re BRILLIANT.  You just saved me about 2 hours of Googling and swearing.</p>
<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wilson keenan</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-295</link>
		<dc:creator>wilson keenan</dc:creator>
		<pubDate>Sat, 29 Jan 2011 01:44:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-295</guid>
		<description>Cool - thanks!

So, my question is pretty easy then - 

If I use a require_once function for my PHP form handler (in the header.php file) as part of a condition that says: If form submitted, require this .php file.

And, this form handler php file starts a session, will it work.  That may not be enough info, but might you have any suggestions that could help me detect the errors?  Right now I&#039;m not getting anything other than something that tells me the API did not work.

All of this is working at: http://www.wilsonkeenan.com/learningphp/DoDirectPayment.php - - it&#039;s just when I try to move everything into PHP = not working...</description>
		<content:encoded><![CDATA[<p>Cool &#8211; thanks!</p>
<p>So, my question is pretty easy then &#8211; </p>
<p>If I use a require_once function for my PHP form handler (in the header.php file) as part of a condition that says: If form submitted, require this .php file.</p>
<p>And, this form handler php file starts a session, will it work.  That may not be enough info, but might you have any suggestions that could help me detect the errors?  Right now I&#8217;m not getting anything other than something that tells me the API did not work.</p>
<p>All of this is working at: <a href="http://www.wilsonkeenan.com/learningphp/DoDirectPayment.php" rel="nofollow">http://www.wilsonkeenan.com/learningphp/DoDirectPayment.php</a> &#8211; - it&#8217;s just when I try to move everything into PHP = not working&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: badlyDrawnToy</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-294</link>
		<dc:creator>badlyDrawnToy</dc:creator>
		<pubDate>Fri, 28 Jan 2011 12:47:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-294</guid>
		<description>Wilson, like the previous commenter said, a standalone template might be easier. Couldn&#039;t begin to guess what issue you&#039;re having re: PayPal API. First thing I&#039;d check is that your standalone script executes fine form your webserver - i.e. it&#039;s not an connectivity issue

Good Luck</description>
		<content:encoded><![CDATA[<p>Wilson, like the previous commenter said, a standalone template might be easier. Couldn&#8217;t begin to guess what issue you&#8217;re having re: PayPal API. First thing I&#8217;d check is that your standalone script executes fine form your webserver &#8211; i.e. it&#8217;s not an connectivity issue</p>
<p>Good Luck</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: badlyDrawnToy</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-293</link>
		<dc:creator>badlyDrawnToy</dc:creator>
		<pubDate>Fri, 28 Jan 2011 12:45:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-293</guid>
		<description>Hi David

I wrote this post a while back and have since used templates much more. I ave a love/hate relationship with WordPress and PHP (I was a Java dev, and have noe moed onto Django/Python).

A standalone template is an easier option. Not even sure these were available when I wrote this article? The key point about Response Headers is still a potential gotcha.</description>
		<content:encoded><![CDATA[<p>Hi David</p>
<p>I wrote this post a while back and have since used templates much more. I ave a love/hate relationship with WordPress and PHP (I was a Java dev, and have noe moed onto Django/Python).</p>
<p>A standalone template is an easier option. Not even sure these were available when I wrote this article? The key point about Response Headers is still a potential gotcha.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wilson keenan</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-291</link>
		<dc:creator>wilson keenan</dc:creator>
		<pubDate>Fri, 28 Jan 2011 02:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-291</guid>
		<description>Hi - really great post.  Thanks so much.

I&#039;m in the process of trying to run a few PHP files to handle an HTML form I have on one of my pages: https://globalcitizenyear.org/donate/donation-form-2 - - the handler sends an API call to PayPal.

I can get this to work quite well in simple PHP (outside of wordpress - where I can actually use the .php file in the &quot;action&quot; and also rely on an error page etc), but I have been unable to get it to work in Wordpress.  Do you have any thoughts?

Also, given that you are taking care of this all on one page - how could you force the form to hide after submission?

My organization really needs to get this issue taken care of</description>
		<content:encoded><![CDATA[<p>Hi &#8211; really great post.  Thanks so much.</p>
<p>I&#8217;m in the process of trying to run a few PHP files to handle an HTML form I have on one of my pages: <a href="https://globalcitizenyear.org/donate/donation-form-2" rel="nofollow">https://globalcitizenyear.org/donate/donation-form-2</a> &#8211; - the handler sends an API call to PayPal.</p>
<p>I can get this to work quite well in simple PHP (outside of wordpress &#8211; where I can actually use the .php file in the &#8220;action&#8221; and also rely on an error page etc), but I have been unable to get it to work in WordPress.  Do you have any thoughts?</p>
<p>Also, given that you are taking care of this all on one page &#8211; how could you force the form to hide after submission?</p>
<p>My organization really needs to get this issue taken care of</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/comment-page-1/#comment-288</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 25 Jan 2011 05:36:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlydrawntoy.com/?p=285#comment-288</guid>
		<description>Great article!  
Definitely not the way I would have done it, but I learned a lot.  I really do appreciate your humility in admitting wordpress isn&#039;t your trade, although Php obviously is.  I&#039;m sure your method is still better, but I would have developed a seperate page template.  I guess I&#039;m just more comfortable with my approach.  It wouldn&#039;t require any Php getting inserted into backend, where making content, instead it would all stay in the Php template files.  Customize the template appropriately to the form, then when making a post, choose that template instead.  (kinda like page v post, or custom post type).  

I didn&#039;t know about the WP email function, and the suggestions you gave on that were great.  It&#039;s helpful not to resort to regular php functions when WP already has them integrated.  Thanks!
~David</description>
		<content:encoded><![CDATA[<p>Great article!<br />
Definitely not the way I would have done it, but I learned a lot.  I really do appreciate your humility in admitting wordpress isn&#8217;t your trade, although Php obviously is.  I&#8217;m sure your method is still better, but I would have developed a seperate page template.  I guess I&#8217;m just more comfortable with my approach.  It wouldn&#8217;t require any Php getting inserted into backend, where making content, instead it would all stay in the Php template files.  Customize the template appropriately to the form, then when making a post, choose that template instead.  (kinda like page v post, or custom post type).  </p>
<p>I didn&#8217;t know about the WP email function, and the suggestions you gave on that were great.  It&#8217;s helpful not to resort to regular php functions when WP already has them integrated.  Thanks!<br />
~David</p>
]]></content:encoded>
	</item>
</channel>
</rss>

