Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange 302 redirect breaking my $_POST
    primarykey
    data
    text
    <p>I am submitting from a form to another php page which is supposed to process it. The problem is that the $_POST is often empty when I try to read it.</p> <p>This is the form: </p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Order Form&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="mailorder" name="mailorder" action="mailordertest.php" method="post"&gt; &lt;input type="hidden" name="A212-M" value="1" /&gt; &lt;input type="hidden" name="A212-XXXL" value="2" /&gt; &lt;input type="hidden" name="A212-XXL" value="3" /&gt; &lt;input type="hidden" name="A212-XL" value="4" /&gt; &lt;input type="submit" value="Confirm Order"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And this is the processing page:</p> <pre><code>&lt;?php session_start(); error_reporting(E_ALL); print_r($_POST); ?&gt; </code></pre> <p>This will usually output nothing but Array (), but sometimes the data will come through first time. When the $_POST is empty, I can hit Back and then resubmit and after a few tries, it will work.</p> <p>I have inspected the whole shebang with FireBug and it seems that the $_POST is getting cleared because the processing page does a 302 redirect back to itself (that obviously uses a GET, and so the POST data is discarded).</p> <p>I have googled this to death, but none of the answers I have found have been any help. The following are NOT the problem: 1. post_max_size is set to 8M (not MB) 2. There is no CONTENT_TYPE issue</p> <p>Other PHP apps are working fine on the server (Wordpress etc), and I am using PHP 5.2.9.</p> <p>I am totally stumped on this one - so thanks for ANY ideas and help!</p> <p>Edit: I should also mention that I have tried various methods of disabling caching with no success either.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload