title: How do you make trigger_error in PHP redirect to a specified page?
body: <pre><code>&lt;?php if(!$user-&gt;data['is_registered'])
  {
      if ($user-&gt;data['user_id'] != ANONYMOUS)
      {
          trigger_error('NOT_AUTHORISED');
      }
  
      login_box('', $user-&gt;lang['NOT_AUTHORISED']);
  }
  ?&gt;
  </code></pre>
  
  <p>I am trying to override this code's default actions and just redirect to page of my choice on trigger_rror.</p>
  
  <pre><code>&lt;?php if(!$user-&gt;data['is_registered'])
  {
      if ($user-&gt;data['user_id'] != ANONYMOUS)
      {
          trigger_error($redirect="error.php", E_ALL);
      }
  }
  ?&gt;
  </code></pre>
  
  <p>And many variations of it gives no luck. Anyone got an idea for me?</p>