[Mediawiki-l] Tie in a script?

Rob Church robchur at gmail.com
Mon Apr 16 08:19:06 UTC 2007


On 16/04/07, Steve Finkelstein <sf at stevefink.net> wrote:
>       $wgOut->addHTML('<form method="POST"
> action="'.$_SERVER['PHP_SELF'].'">');

Variables won't be interpolated inside single quotes. Use something like:

global $wgTitle;
$action = $wgTitle->escapeLocalUrl();
$wgOut->addHtml( "<form method=\"post\" action=\"{$action}\">" );

[The use of $wgTitle, or another constructed Title object representing
the special page, is the standard method of obtaining a canonical URL
in MediaWiki.]


Rob Church



More information about the MediaWiki-l mailing list