<?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 avoid POSTDATA resend warning</title>
	<atom:link href="http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/</link>
	<description>Exploring PHP, MySql, Javascript, jQuery, Zend Framework and more... from Bangladesh</description>
	<lastBuildDate>Sat, 20 Mar 2010 09:10:04 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ray</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-3879</link>
		<dc:creator>ray</dc:creator>
		<pubDate>Sat, 06 Mar 2010 11:32:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-3879</guid>
		<description>In the URL window of firefox type about:config
Change this setting in firefox
browser.sessionstore.postdata
Change from a 0 to 1</description>
		<content:encoded><![CDATA[<p>In the URL window of firefox type about:config<br />
Change this setting in firefox<br />
browser.sessionstore.postdata<br />
Change from a 0 to 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carvill23</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-3866</link>
		<dc:creator>carvill23</dc:creator>
		<pubDate>Wed, 03 Mar 2010 02:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-3866</guid>
		<description>sorry i wrote it wrong (zubfatal)</description>
		<content:encoded><![CDATA[<p>sorry i wrote it wrong (zubfatal)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carvill23</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-3865</link>
		<dc:creator>carvill23</dc:creator>
		<pubDate>Wed, 03 Mar 2010 02:14:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-3865</guid>
		<description>thanks subfatal. It works, i&#039;ll be testing it</description>
		<content:encoded><![CDATA[<p>thanks subfatal. It works, i&#8217;ll be testing it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anis Ahmad</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-3620</link>
		<dc:creator>Anis Ahmad</dc:creator>
		<pubDate>Thu, 31 Dec 2009 03:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-3620</guid>
		<description>@Les
&quot;The best course of action is just to do a redirect after POSTing data&quot; :D

Did u actually read this post?</description>
		<content:encoded><![CDATA[<p>@Les<br />
&#8220;The best course of action is just to do a redirect after POSTing data&#8221; <img src='http://www.ajaxray.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Did u actually read this post?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Les</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-3619</link>
		<dc:creator>Les</dc:creator>
		<pubDate>Wed, 30 Dec 2009 23:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-3619</guid>
		<description>You can think up how ever number of solutions but the problem will still remain; you are only really masking it.

The best course of action is just to do a redirect after POSTing data and be done with it - just accept that there are going to be people out there who will abuse how the HTTP protocol works.</description>
		<content:encoded><![CDATA[<p>You can think up how ever number of solutions but the problem will still remain; you are only really masking it.</p>
<p>The best course of action is just to do a redirect after POSTing data and be done with it &#8211; just accept that there are going to be people out there who will abuse how the HTTP protocol works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ??????? &#187; [Web] ????</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-3536</link>
		<dc:creator>??????? &#187; [Web] ????</dc:creator>
		<pubDate>Wed, 25 Nov 2009 02:40:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-3536</guid>
		<description>[...] How to avoid POSTDATA resend warning [...]</description>
		<content:encoded><![CDATA[<p>[...] How to avoid POSTDATA resend warning [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zubfatal</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-2800</link>
		<dc:creator>zubfatal</dc:creator>
		<pubDate>Fri, 05 Jun 2009 22:29:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-2800</guid>
		<description>I found this post, and it got my noodle cooking - heres what I came up with.

Rather than using one or more other pages, after submission, I usually reuse the same page, do validation db inserts and what not.

In the top of your whatever.php place this:

session_start();

if ($_SERVER[&quot;REQUEST_METHOD&quot;] == &quot;POST&quot;) {
  $_SESSION[&quot;__POSTFIELDS&quot;] = serialize($_POST);
  header(&quot;Location: ?check&quot;);
}

else {
  if (strlen($_SESSION[&quot;__POSTFIELDS&quot;]) &gt; 0) {
    $_POST = unserialize($_SESSION[&quot;__POSTFIELDS&quot;]);
  }
}

This way, we keep track of all the postdata, and re-assign them to $_POST so we can proceed with our validation stuff, like so:

if ((isset($_GET[&quot;check&quot;])) &amp;&amp; (strlen($_SESSION[&quot;__POSTFIELDS&quot;]) &gt; 0)) {
  if (strlen(trim($_POST[&quot;usr&quot;])) &lt; 1) { 
    echo &quot;Username missing.&quot;;
  }

  if (strlen(trim($_POST[&quot;pwd&quot;])) &lt; 1) { 
    echo &quot;Password missing.&quot;;
  }
}

Also the form fields gets their values re-assigned using the appropriate post field.

In case this doesn&#039;t make any sense, you can see my example here:
http://sandbox.datapimp.dk/post/

I must admit i haven&#039;t tested this completely yet, so it might have one or more drawbacks :)</description>
		<content:encoded><![CDATA[<p>I found this post, and it got my noodle cooking &#8211; heres what I came up with.</p>
<p>Rather than using one or more other pages, after submission, I usually reuse the same page, do validation db inserts and what not.</p>
<p>In the top of your whatever.php place this:</p>
<p>session_start();</p>
<p>if ($_SERVER["REQUEST_METHOD"] == &#8220;POST&#8221;) {<br />
  $_SESSION["__POSTFIELDS"] = serialize($_POST);<br />
  header(&#8221;Location: ?check&#8221;);<br />
}</p>
<p>else {<br />
  if (strlen($_SESSION["__POSTFIELDS"]) &gt; 0) {<br />
    $_POST = unserialize($_SESSION["__POSTFIELDS"]);<br />
  }<br />
}</p>
<p>This way, we keep track of all the postdata, and re-assign them to $_POST so we can proceed with our validation stuff, like so:</p>
<p>if ((isset($_GET["check"])) &amp;&amp; (strlen($_SESSION["__POSTFIELDS"]) &gt; 0)) {<br />
  if (strlen(trim($_POST["usr"])) &lt; 1) {<br />
    echo &#8220;Username missing.&#8221;;<br />
  }</p>
<p>  if (strlen(trim($_POST["pwd"])) &lt; 1) {<br />
    echo &#8220;Password missing.&#8221;;<br />
  }<br />
}</p>
<p>Also the form fields gets their values re-assigned using the appropriate post field.</p>
<p>In case this doesn&#8217;t make any sense, you can see my example here:<br />
<a href="http://sandbox.datapimp.dk/post/" rel="nofollow">http://sandbox.datapimp.dk/post/</a></p>
<p>I must admit i haven&#8217;t tested this completely yet, so it might have one or more drawbacks <img src='http://www.ajaxray.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: isaias</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-2749</link>
		<dc:creator>isaias</dc:creator>
		<pubDate>Tue, 26 May 2009 10:51:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-2749</guid>
		<description>can someone tell me bout these codes?
u guys keep mentioning them on how to redirect 
the web page but not how use them, can someone help me out?</description>
		<content:encoded><![CDATA[<p>can someone tell me bout these codes?<br />
u guys keep mentioning them on how to redirect<br />
the web page but not how use them, can someone help me out?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-2708</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Sun, 17 May 2009 05:51:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-2708</guid>
		<description>Hi there,

One thing to keep in mind, is that your HTTP status code should also be 303 rather than 302, so that it is standards compliant AND future safe for new browsers that may come out.

This is easily doable by modifying:

header(&#039;Location: SUCCESSPAGE&#039;);
to
header(&#039;Location: SUCCESSPAGE&#039;, true, 303);

Cheers,
Sam</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>One thing to keep in mind, is that your HTTP status code should also be 303 rather than 302, so that it is standards compliant AND future safe for new browsers that may come out.</p>
<p>This is easily doable by modifying:</p>
<p>header(&#8217;Location: SUCCESSPAGE&#8217;);<br />
to<br />
header(&#8217;Location: SUCCESSPAGE&#8217;, true, 303);</p>
<p>Cheers,<br />
Sam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nem</title>
		<link>http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/comment-page-1/#comment-2545</link>
		<dc:creator>Nem</dc:creator>
		<pubDate>Fri, 30 Jan 2009 09:56:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/#comment-2545</guid>
		<description>Thnx datafake, your tip was very usefull. Explorer isn&#039;t ;)</description>
		<content:encoded><![CDATA[<p>Thnx datafake, your tip was very usefull. Explorer isn&#8217;t <img src='http://www.ajaxray.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
