Note that there are some explanatory texts on larger screens.

plurals
  1. POZend Framework - Submit contains no Post Data
    primarykey
    data
    text
    <p>My issue seems similiar to <a href="https://stackoverflow.com/questions/5005340/zend-framework-on-submit-the-form-dont-display-its-post-data">On submit the form don&#39;t display its POST data</a> and related questions, but the suggested solutions do not apply to my project, so I am currently not using redirects.</p> <p>I am attempting to learn Zend Framework. The current project that I am working on has run into an issue where the the $_POST and $_GET superglobals passed from my form are returning empty. I have worked to simplify the issue to identify where it is being caused, but I seem to have hit a brick wall. It seems that no POST data is being sent at all...</p> <p>My View:</p> <pre><code>&lt;form method="post" action="/character/addsubmit"&gt; &lt;input type=hidden name='test' id='test' value='test'&gt; &lt;input type='submit'&gt; &lt;/form&gt; </code></pre> <p>My controller:</p> <pre><code>&lt;?php class CharacterController extends Zend_Controller_Action { public function addsubmitAction() { Zend_Debug::dump($this-&gt;getRequest()); echo "&lt;br/&gt;\$_POST: &lt;br/&gt;"; print_r($_POST); echo "&lt;br/&gt;\$_GET: &lt;br/&gt;"; print_r($_GET); echo "&lt;br/&gt;&lt;br/&gt;"; if($this-&gt;_request-&gt;isPost()) { echo "\$_POST Found&lt;br/&gt;"; } else { echo "\$_POST Not Found &lt;br/&gt;"; } if ($this-&gt;_request-&gt;isGet()) { echo "\$_GET Found&lt;br/&gt;"; } else { echo "\$_GET Not Found&lt;br/&gt;"; } } } ?&gt; </code></pre> <p>By Navigating to the form, then submitting (by clicking on the submit button), I receive the following output:</p> <pre><code>object(Zend_Controller_Request_Http)#8 (15) { ["_paramSources:protected"] =&gt; array(2) { [0] =&gt; string(4) "_GET" [1] =&gt; string(5) "_POST" } ["_requestUri:protected"] =&gt; string(20) "/character/addsubmit" ["_baseUrl:protected"] =&gt; string(0) "" ["_basePath:protected"] =&gt; NULL ["_pathInfo:protected"] =&gt; string(20) "/character/addsubmit" ["_params:protected"] =&gt; array(3) { ["controller"] =&gt; string(9) "character" ["action"] =&gt; string(9) "addsubmit" ["module"] =&gt; string(7) "default" } ["_rawBody:protected"] =&gt; NULL ["_aliases:protected"] =&gt; array(0) { } ["_dispatched:protected"] =&gt; bool(true) ["_module:protected"] =&gt; string(7) "default" ["_moduleKey:protected"] =&gt; string(6) "module" ["_controller:protected"] =&gt; string(9) "character" ["_controllerKey:protected"] =&gt; string(10) "controller" ["_action:protected"] =&gt; string(9) "addsubmit" ["_actionKey:protected"] =&gt; string(6) "action" } $_POST: Array ( ) $_GET: Array ( ) $_POST Not Found $_GET Found </code></pre> <p>The one thing that's really throwing me for a loop is that the isGet function is returning true..</p> <p>Does anyone with more knowledge of Zend have any idea of why I'm having so much trouble submitting forms with this framework? Is there some configuration that I might have missed or may have set incorrectly that might cause this?</p> <p>Note: I am using Zend_Form for the actually application, as well as using more of the framework itself, but I have scaled it back in attempting to debug this issue. If you need any further information about my configuration, I will be able to provide it.</p> <p>Thanks!</p> <p>Edit: </p> <p>My .htaccess file's contents:</p> <p>[I have removed these lines because it was the wrong file, I am still looking for the correct one.]</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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