Jump to content

Getting Internal Server Error When I Go From One Page To Another


yoursurrogategod

Recommended Posts

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.