0

I implemented a Form with a submission treatment by controller.

At the end of the treatment, I would like to redirect to the form submission page.

I tried several things :

$this->_redirect('*/*/');

and

$this->_redirectReferer();

I also tried to place the form submission url in the form by adding :

<input name="redirect_url" type="hidden" value="<?php echo $this->helper('core/url')->getCurrentUrl() ?>" />

and in the controller :

$post = $this->getRequest()->getPost();
…
$this->_redirect($post['redirect_url']);

But none of these solutions are working… Any help please?

2

Good guide with some options here. I normally use $this->_redirectUrl($url);

3
  • thank you for your answer. But It is not working for me… I tried : $this->_redirectUrl('http://www.etoto.fr/sales/order/view/order_id/139/'); and Mage::app()->getFrontController()->getResponse()->setRedirect('http://www.etoto.fr/sales/order/view/order_id/139'); ?
    – Alexglvr
    Aug 5 '14 at 6:22
  • I think something might be wrong in your controller. Can you post the code?
    – mbalparda
    Aug 5 '14 at 6:48
  • I had an uncommented "echo" in my code, inducing a "Cannot send headers" error… working fine! thanks again.
    – Alexglvr
    Aug 5 '14 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.