Jump to content

cake php id not beig retrieved in function from url


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?

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']));
			   }

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.