yoursurrogategod Posted December 21, 2012 Share Posted December 21, 2012 This is my page and the relevant code. project/applicaiton/views/scripts/index/index.phtml: <div id="welcome"> Please select the affiliate: <br><br> <?= $this->form ?> </div> project/application/views/scripts/index/units.phtml: <div id="welcome"> Please select department for <?= $this->affiliate ?>: <br><br> <?= $this->form ?> </div> project/application/controllers/IndexController.php: <?php class IndexController extends Zend_Controller_Action { protected $_redirector = null; public function init() { $this->_redirector = $this->_helper->getHelper('Redirector'); } public function indexAction() { $inputForm = new Application_Form_Input(); $inputForm->buildAffiliateSelectForm(); if ($this->_request->isPost()) { $params = $this->_request->getPost(); $affiliateId = $params['affiliateid']; $inputForm->setAffiliateId($affiliateId); if ($inputForm->isValid($params)) { $affiliateParams = array('affiliate' => $affiliateId); $this->_helper->redirector('units', '', null, $affiliateParams); } else { $inputForm->populate($params); } } $this->view->form = $inputForm; } public function unitsAction() { $request = $this->getRequest(); $getAffiliate = $request->getParam('affiliate'); $affiliateId = (isset($getAffiliate)) ? $getAffiliate : $this->options['defaultaffiliateid']; $inputForm = new Application_Form_Input(); $inputForm->setAffiliateId($getAffiliate); $inputForm->buildDepartmentsSelectForm(); $affiliatesTable = new Application_Model_DbTable_Affiliates(); if ($this->_request->isPost()) { $params = $this->_request->getPost(); $affiliateId = $params['affiliateid']; $departmentId = $params['departmentid']; if ($inputForm->isValid($params)) { $params = array('affiliate' => $affiliateId, 'department' => $departmentId); //$this->_helper->redirector('report', // 'report', null, $params); } else { $inputForm->populate($params); } } $this->view->form = $inputForm; } } Now, on index.phtml, when I click the submit button I go from this URL: http://hostname-internal/user-directory/project/ To this: http://hostname-internal/user-directory/project/hldm/units/affiliate/2 And on the second page, I get a 500 Internal Server Error. My question is why? Why not print something, anything, out? What am I missing? Quote Link to comment https://forums.phpfreaks.com/topic/272253-getting-internal-server-error-when-i-go-from-one-page-to-another/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.