Note that there are some explanatory texts on larger screens.

plurals
  1. POHtml post array empty
    text
    copied!<p>I am trying to post HTML to another php and the $_POST array is empty.</p> <pre><code>&lt;?php for($i = 0;$i&lt;count($plans);$i++) { ?&gt; &lt;form id="&lt;?php echo "cart-form-" . $i ?&gt;" method="post" action="&lt;?php echo BASE_URL; ?&gt;browse"&gt; &lt;div class="four columns"&gt; &lt;input type="hidden" name="id" id="id" value="&lt;?php echo $plans[$i]-&gt;id; ?&gt;"&gt; &lt;ul class="pricing-table"&gt; &lt;li class="header item"&gt;&lt;?php echo $plans[$i]-&gt;header ?&gt;&lt;/li&gt; &lt;li class="item"&gt;&lt;?php echo $plans[$i]-&gt;price; ?&gt;&lt;/li&gt; &lt;li class="item"&gt;&lt;?php echo $plans[$i]-&gt;description; ?&gt;&lt;/li&gt; &lt;li class="pricing-table-button"&gt;&lt;button class="std-button" type="submit"&gt;Buy&lt;/button&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/form&gt; &lt;?php } ?&gt; </code></pre> <p>On the browse page, i got empty array.</p> <pre><code>print "CONTENT_TYPE: " . $_SERVER['CONTENT_TYPE'] . "&lt;BR /&gt;"; $data = file_get_contents('php://input'); print "DATA: &lt;pre&gt;"; var_dump($data); var_dump($_POST); print "&lt;/pre&gt;"; </code></pre> <p>Rendered HTML</p> <pre><code>&lt;form id="cart-form-0" action="/browseselection" method="post"&gt; &lt;div class="four columns"&gt; &lt;input id="id" value="1" name="id"&gt; &lt;ul class="pricing-table"&gt; &lt;li class="header item"&gt;Product ABC&lt;/li&gt; &lt;li class="item"&gt;$123&lt;/li&gt; &lt;li class="item"&gt;5&lt;/li&gt; &lt;li class="pricing-table-button"&gt; &lt;button class="std-button" type="submit"&gt;Buy&lt;/button&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p></p>
 

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