Thread: cosmetic issues
View Single Post
Old 1st January 2007, 20:22
danf.1979 danf.1979 is offline
Senior Member
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979

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())));

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)

$tail "";

    if (
        foreach (
$url_vars  as $var => $value)
$tail .= $var."=".urlencode($value)."&";

$tail substr($tail0strlen($tail) - strlen("&"));

    if (
$tail != ""$tail "&".$tail;


Is not ideal, but it could be done in some hours...
Reply With Quote