Page 1 of 1

Redirect module function

Posted: Wed Aug 24, 2005 12:11 pm
by brownrl
Dear all,

it seems that the 'Redirect' function for a module has this & in the redirecting.

I have made this function in addition:

Code: Select all

function RedirectNoAmp( $id, $action, $returnid='')
    {
        global $gCms;
        $config = $gCms->config;

        $name = $this->GetName();

        $text = 'moduleinterface.php?module='.$name.'&'.$id.'action='.$action.'&id='.$id;
        if ($returnid != '')
        {
            $text .= '&'.$id.'returnid='.$returnid;
        }
        redirect($text);
    }
Wishy I took out the amp after &'s is this correct?

This seems to work and bring the browser to the appropriate action for the appropriate module for this call in module code.

$this->Redirect( $id , 'some_action', $resultid );

Re: Redirect module function

Posted: Wed Aug 24, 2005 1:12 pm
by Ted
No, you're right.  Redirects shouldn't need an &, because they're handled via headers and not (x)html.  I'll make that change.