Jump to content

cake php id not beig retrieved in function from url


devilinc

Recommended Posts

i have a form that validates...if validation takes place correctly i just lose my 'id'...this "id" is needed to be passed to my url to save the form values to this particular category of 'id'....if data is correct and no validation required and i submit form i get the id passed to and stores correctly......what do i do?

Link to post
Share on other sites

here is my code for better understanding only the save or not save part

if ($this->Customer->save($this->data)) 
		   {
				// $this->redirect(array('controller' => 'realteams', 'action' => 'index'));			

				//$data = $this->paginate('Customer');
				 $this->redirect(array('action' => '/customerslist/'.$_SESSION['department_id']));
				  unset($_SESSION['department_id']);
				  ob_flush();
		   }
		   else 
		   {
			  $this->Session->setFlash(__('The Customer could not be saved. Please, try again.', true));
			  //$this->redirect(array('action' => '/customerscreate/'.$_SESSION['department_id']));
			   }

 

Link to post
Share on other sites

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.