<?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/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: PHP Form Helper &#8211; Submit&#160;Listener</title> <atom:link href="http://davidwalsh.name/php-form-helper-submit-listener/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/php-form-helper-submit-listener</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Thu, 09 Feb 2012 15:40:33 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3</generator> <item><title>By: cxcxcx32323232</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-23898</link> <dc:creator>cxcxcx32323232</dc:creator> <pubDate>Fri, 06 May 2011 09:46:57 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-23898</guid> <description>dsf dsfdsfsdf  fdsfsdf</description> <content:encoded><![CDATA[<p>dsf dsfdsfsdf  fdsfsdf</p> ]]></content:encoded> </item> <item><title>By: René Monroy</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-2223</link> <dc:creator>René Monroy</dc:creator> <pubDate>Tue, 08 Jul 2008 20:00:14 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-2223</guid> <description>As expected, it wasn&#039;t the script, htaccess &#039;rewriterule&#039; was causing some conflicts and it&#039;s ok now.By the way, thanks for the additional info,Regards</description> <content:encoded><![CDATA[<p>As expected, it wasn&#8217;t the script, htaccess &#8216;rewriterule&#8217; was causing some conflicts and it&#8217;s ok now.</p><p>By the way, thanks for the additional info,</p><p>Regards</p> ]]></content:encoded> </item> <item><title>By: david</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-2212</link> <dc:creator>david</dc:creator> <pubDate>Tue, 08 Jul 2008 11:53:25 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-2212</guid> <description>&lt;p&gt;@René:  I&#039;ve not noticed that.  I do know that if a value is empty that MooTools may strip the entire variable out of the POST.  Are you sure the form field is being populated?&lt;/p&gt;</description> <content:encoded><![CDATA[<p>@René:  I&#8217;ve not noticed that.  I do know that if a value is empty that MooTools may strip the entire variable out of the POST.  Are you sure the form field is being populated?</p> ]]></content:encoded> </item> <item><title>By: René Monroy</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-2208</link> <dc:creator>René Monroy</dc:creator> <pubDate>Tue, 08 Jul 2008 09:10:33 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-2208</guid> <description>Talking about forms, I&#039;m using mootools to request a php page which I want to have the isset function but... did you notice that elements can´t be handled by isset through ajax by post method? Nevertheless, It seems to be good with get method, well almost, first input disappears to me :SMaybe it&#039;s something in my JavaScript function, but without the isset there&#039;s no failures, what do you think David, am I wrong or something?</description> <content:encoded><![CDATA[<p>Talking about forms, I&#8217;m using mootools to request a php page which I want to have the isset function but&#8230; did you notice that elements can´t be handled by isset through ajax by post method? Nevertheless, It seems to be good with get method, well almost, first input disappears to me :S</p><p>Maybe it&#8217;s something in my JavaScript function, but without the isset there&#8217;s no failures, what do you think David, am I wrong or something?</p> ]]></content:encoded> </item> <item><title>By: Tom Dings</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-274</link> <dc:creator>Tom Dings</dc:creator> <pubDate>Fri, 11 Apr 2008 18:22:46 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-274</guid> <description>Great function .. Works like a charm. I did some little modification but it is not worth showing here .. But thanks anyway for your great help.</description> <content:encoded><![CDATA[<p>Great function .. Works like a charm. I did some little modification but it is not worth showing here .. But thanks anyway for your great help.</p> ]]></content:encoded> </item> <item><title>By: Aaron Saray</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-273</link> <dc:creator>Aaron Saray</dc:creator> <pubDate>Fri, 04 Jan 2008 16:31:35 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-273</guid> <description>Ahh! It chopped off the rest of my example.... :(  (I showed an xss example... maybe thats why)Basically in summary - I was just saying that make sure you do clean your input before you redisplay... otherwise you could get xss - but I&#039;m assuming you&#039;re already doing this.  In my method, I store the whiteListed data in a session - and programatically(if thats a word) fill up a $values array on my form page again.Anyways - thanks David for responding - feel free to stop by my blog and leave long winded responses like I&#039;ve done to you!  sorry! :)
-aaron</description> <content:encoded><![CDATA[<p>Ahh! It chopped off the rest of my example&#8230;. :(  (I showed an xss example&#8230; maybe thats why)</p><p>Basically in summary &#8211; I was just saying that make sure you do clean your input before you redisplay&#8230; otherwise you could get xss &#8211; but I&#8217;m assuming you&#8217;re already doing this.  In my method, I store the whiteListed data in a session &#8211; and programatically(if thats a word) fill up a $values array on my form page again.</p><p>Anyways &#8211; thanks David for responding &#8211; feel free to stop by my blog and leave long winded responses like I&#8217;ve done to you!  sorry! :)<br
/> -aaron</p> ]]></content:encoded> </item> <item><title>By: Aaron Saray</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-272</link> <dc:creator>Aaron Saray</dc:creator> <pubDate>Fri, 04 Jan 2008 16:27:40 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-272</guid> <description>Do you clean all of the posted information first before repopulating the page?  It could be possible for them to insert a custom type of error into one of the forms, which might error out, and then put content into your page....  think:What if they put:
&quot; /&gt;</description> <content:encoded><![CDATA[<p>Do you clean all of the posted information first before repopulating the page?  It could be possible for them to insert a custom type of error into one of the forms, which might error out, and then put content into your page&#8230;.  think:</p><p>What if they put:<br
/> &#8221; /&gt;</p> ]]></content:encoded> </item> <item><title>By: david</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-271</link> <dc:creator>david</dc:creator> <pubDate>Thu, 03 Jan 2008 21:48:16 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-271</guid> <description>Thanks for sharing Aaron.I do all the post processing and form/display on one page.  It&#039;s much easier to put existing form values into place when there is an error (instead of making them type their valid values back in).</description> <content:encoded><![CDATA[<p>Thanks for sharing Aaron.</p><p>I do all the post processing and form/display on one page.  It&#8217;s much easier to put existing form values into place when there is an error (instead of making them type their valid values back in).</p> ]]></content:encoded> </item> <item><title>By: Aaron Saray</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-270</link> <dc:creator>Aaron Saray</dc:creator> <pubDate>Thu, 03 Jan 2008 21:05:45 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-270</guid> <description>I&#039;m a little confused as to the real reason to develop in this method.  It seems that you&#039;re either:
1) developing all your display and processing in one page
or
2) not handling someone surfing directly to your posting script transparently in an already proven wayThis is the method that I use:
post.php
-- has the form, the tokens embedded
-- posts to post.process.phppost.process.php
-- checks for embedded token - if not, redirects back to post.php
-- has an array of expected - whitelisted data.  Checks post variables for all of them in a loop, scrubbing them, and putting them into a clean array
-- check clean array for required things.  If good, continue, if bad, store error and redirect back to post.php
-- after process, redirect to post.success.php (if necessary, post.success could check some sort of session information ot make sure you came from post.process.php... .not always necessary)What user sees:
post.php to post.success.php  (redirect is usually transparent to user, not to browser, however) on success.
post.php to post.php on error.what happens if:
user surfs to post.process.php? - redirect to post.php because first check is for the CSRF token - very little overhead and a good method to remember to stay secure
user surfs to post.success.php?  - might show success message (that is if you haven&#039;t set a session variable to redirect them away) but with no real action.I hope this helps...If I&#039;m missing something about your reason for implementation, please let me know.  thanks! :)</description> <content:encoded><![CDATA[<p>I&#8217;m a little confused as to the real reason to develop in this method.  It seems that you&#8217;re either:<br
/> 1) developing all your display and processing in one page<br
/> or<br
/> 2) not handling someone surfing directly to your posting script transparently in an already proven way</p><p>This is the method that I use:<br
/> post.php<br
/> &#8211; has the form, the tokens embedded<br
/> &#8211; posts to post.process.php</p><p>post.process.php<br
/> &#8211; checks for embedded token &#8211; if not, redirects back to post.php<br
/> &#8211; has an array of expected &#8211; whitelisted data.  Checks post variables for all of them in a loop, scrubbing them, and putting them into a clean array<br
/> &#8211; check clean array for required things.  If good, continue, if bad, store error and redirect back to post.php<br
/> &#8211; after process, redirect to post.success.php (if necessary, post.success could check some sort of session information ot make sure you came from post.process.php&#8230; .not always necessary)</p><p>What user sees:<br
/> post.php to post.success.php  (redirect is usually transparent to user, not to browser, however) on success.<br
/> post.php to post.php on error.</p><p>what happens if:<br
/> user surfs to post.process.php? &#8211; redirect to post.php because first check is for the CSRF token &#8211; very little overhead and a good method to remember to stay secure<br
/> user surfs to post.success.php?  &#8211; might show success message (that is if you haven&#8217;t set a session variable to redirect them away) but with no real action.</p><p>I hope this helps&#8230;</p><p>If I&#8217;m missing something about your reason for implementation, please let me know.  thanks! :)</p> ]]></content:encoded> </item> <item><title>By: MiB</title><link>http://davidwalsh.name/php-form-helper-submit-listener/comment-page-1#comment-269</link> <dc:creator>MiB</dc:creator> <pubDate>Tue, 18 Dec 2007 16:53:59 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/php-form-helper-submit-listener/#comment-269</guid> <description>Hi!In my opinion josh`s and JGM`s approach are the best ones: you can change names of your form fields, and by sure that your form processor correctly catches submitted data.JGM: it`s better to use stripos() or to check whether the $_POST global variable contains any data (count($_POST)&gt;0).Regards</description> <content:encoded><![CDATA[<p>Hi!</p><p>In my opinion josh`s and JGM`s approach are the best ones: you can change names of your form fields, and by sure that your form processor correctly catches submitted data.</p><p>JGM: it`s better to use stripos() or to check whether the $_POST global variable contains any data (count($_POST)&gt;0).</p><p>Regards</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 1/17 queries in 0.010 seconds using disk: basic
Object Caching 866/866 objects using disk: basic

Served from: davidwalsh.name @ 2012-02-09 10:46:41 -->
