Re: Help with Redirect

2009-12-18 Thread kdubya
Oops - I hit Send before I meant to. Anyway, the line of code you posted: link('edit', array('action' => 'edit', 'id' => $compatible['Compatible']['id'], 'product_id' => $product['Product']['id']))?> What line of HTML does it generate? I think you will find the URL generated is not what you want.

Re: Help with Redirect

2009-12-18 Thread kdubya
You are going to have to post more of your code before we can help more. What is on line 24 of edit.ctp? Show the entire edit() function from your compatibles controller. The line of code you supplied: >link('edit', array('action' => 'edit', 'id' => $compatible['Compatible']['id'], 'product_id' =>

Re: Help with Redirect

2009-12-18 Thread Dewayne Pinion
On Fri, Dec 18, 2009 at 12:13 PM, kdubya wrote: > Try either: > $this->redirect(array('controller' => 'compatibles', 'action' => > 'index', 'product_id:'.$product_id)); > which should result in a URL like: > productsadmin/compatibles/index/product_id:3365 > This would be the right address, but

Re: Help with Redirect

2009-12-18 Thread kdubya
On Dec 17, 3:30 pm, Dewayne Pinion wrote: > Ok, apparently I am braindead, because I am still not grasping the concept > of a redirect in cake. I have this page: > >    productsadmin/compatibles/index/product_id:3365 Where does the above syntax come from (specifically the "product:3365" part)? Ty

Re: Help with Redirect

2009-12-18 Thread Foroct
I'm in the same boat as Dewayne. If you are on the edit page for that product and click submit doesnt the product id get passed into the controller? If so then the redirect specified $this->redirect(array('controller' => 'compatibles', 'action' => 'index', 'product_id' => $product_id)); should

Re: Help with Redirect

2009-12-17 Thread Miles J
Redirect does not redirect you to the previous page. If you don't have the ID to the page you want to redirect to, then you cant redirect to it. You need to save that ID somewhere if you want to use it. On Dec 17, 2:01 pm, Dewayne Pinion wrote: > No luck so far. The http_referrer just stayed on

Re: Help with Redirect

2009-12-17 Thread Dewayne Pinion
No luck so far. The http_referrer just stayed on the edit page. Using the code below, I saw null. I did see in the code that I had $id instead, but when I echoed it the id was the related product that I was editing, not the main product page. On Thu, Dec 17, 2009 at 4:48 PM, Andras Kende wrote:

Re: Help with Redirect

2009-12-17 Thread Andras Kende
try before the redirect: echo 'product_id is: ' . $product_id; die(); Andras On Dec 17, 2009, at 4:42 PM, number9 wrote: > In the past I have done that kind of redirect with this: > > $this->redirect($_SERVER['HTTP_REFERER']); > > Not 100% if that will work, but I seem to remember there being

Re: Help with Redirect

2009-12-17 Thread number9
In the past I have done that kind of redirect with this: $this->redirect($_SERVER['HTTP_REFERER']); Not 100% if that will work, but I seem to remember there being an issue with redirecting after editing - perhaps the $product_id is being lost? On Dec 17, 8:30 pm, Dewayne Pinion wrote: > Ok, app

Help with Redirect

2009-12-17 Thread Dewayne Pinion
Ok, apparently I am braindead, because I am still not grasping the concept of a redirect in cake. I have this page: productsadmin/compatibles/index/product_id:3365 That has an edit link. Clicking on it takes me to this page: productsadmin/compatibles/edit/4228 where I can edit the informa