Redirect module function

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
brownrl
Forum Members
Forum Members
Posts: 74
Joined: Thu Sep 23, 2004 11:06 am

Redirect module function

Post 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 );
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Redirect module function

Post 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.
Post Reply

Return to “Developers Discussion”