title: Redirect to previous page after submit in Zend Framework
body: <p>I know this has been answered somewhat but I can't seem to get it work for my specific config. Apologies if this is deemed a duplicate.</p>
  
  <p>I have a cart built in Zend with a button that points to a login page via:</p>
  
  <pre><code>if(!$session-&gt;id)
  {
    header('Location:'.$fullurl.'login');
  }
  </code></pre>
  
  <p>The button is inside a form by itself. I've tried Arne's suggestion below with no dice. 
  Form code:</p>
  
  <pre><code>&lt;form name="" action="' . $fullurl . 'continue" method="post"&gt;
     &lt;input type="submit" name="topay" value="CONTINUE SHOPPING" /&gt;
  &lt;/form&gt;';
  </code></pre>
  
  <p>How do I get and redirect to the last page visited rather than going to /login?</p>
  
  <p>I've tried doing the old HTTP_REFERER method but couldn't get it to work in Zend.. I understand there's a different method in Zend but can't get it to work from various answers <a href="https://stackoverflow.com/questions/1249274/redirect-to-previous-page-in-zend-framework">here</a> and <a href="https://stackoverflow.com/questions/9168061/how-to-redirect-a-page-through-controller-in-zend">here</a>.</p>
  
  <p>Any help is greatly appreciated. </p>