function ff_redirect($url, $target='self', $method='post')
{
    global $ff_processor, $ff_request;
    if ($ff_processor->dying) return;
    ob_end_clean();			//when debugging change this to ob_end_flush();
    switch (strtolower($method)) {
        case 'get': {
            switch (strtolower($target)) {
                case 'top'   :
                case 'parent': break;
                default      : $target = 'window'; //window > document, because cross browser compat, or so I read
            } // switch
            echo '<script type="text/javascript">'.nl().
                 "onload=function() { ".$target.".location.href='".$url."'; }".nl().
                 '</script>'.nl().
                 '</body>'.nl();
            break;
        } // url
        default: { // post
            $pos = strpos($url,'?');	//find the location of '?' after which get parameters usually start
            $ff_request = array();		//create an array to set it later to hold get parameters in associative form
			if($pos){					//if query parameters are supplied, the whole action becomes http://whatever.com/
				$action=substr($url, 0, $pos);
			}else{						//if no '?' detected action is equal to supplied url, which is a weak check because what if pretty url?
				$action = $url;
			}
            switch (strtolower($target)) {
                case 'blank' : $target = ' target="_blank"';  break;
                case 'top'   : $target = ' target="_top"';    break;
                case 'parent': $target = ' target="_parent"'; break;
                default      : $target = ' target="_self"';
            } // switch
			$parts = parse_url($url); 			//$url still stores are query params, so we parse them
			parse_str($parts['query'], $ff_request);		//get query part and store into ff_request (defined above)
            echo '<script language="javascript" type="text/javascript">'.nl(). //echo form and script that submits form on load (ajax maybe, more 'elegant'?)
                 '<!--'.nl().
                 'onload = function() { document.ff_redirect.submit(); }'.nl().
                 '-->'.nl().
                 '</script>'.nl().
                 '<form action="'.$action.'" '.
                  'method="post" '.
                  'name="ff_redirect" id="ff_redirect" '.
                  'enctype="multipart/form-data"'.
                  $target.
                 '>'.nl();
            foreach ($ff_request as $key => $value){ //print out input fields which store GET parameters
				echo '<input type="hidden" name="'.$key.'" '.'value="'.htmlentities(urldecode($value)).'"/>'.nl();
			}
            echo '</form>'.nl(). '</body>'.nl();
        } // post
    } // switch
    exit;
} // ff_redirect