When I want to return to the same place after inserting some data to mysql I do it this way, when processing the form
PHP Code:
if ($_POST["save_form"] == LAN_BUTTON_SAVE_AND_COME_BACK)
$api->redirect($api->tpl->turl("sameform", array("act" => "edit", "id" => $api->db->insert_id())));
else $api->redirect($api->turl->("main.php"));
Uhm, maybe the navigation could use something like that. turl function just worries about the session id and url vars:
PHP Code:
public function turl($url, $url_vars=false)
{
global $api, $pn_info;
$tail = "";
if (is_array($url_vars))
{
foreach ($url_vars as $var => $value)
$tail .= $var."=".urlencode($value)."&";
$tail = substr($tail, 0, strlen($tail) - strlen("&"));
}
if ($tail != "") $tail = "&".$tail;
return $url."?s=".$pn_info["session"]["id"].$tail;
}
Is not ideal, but it could be done in some hours...