Topic on Project:Support desk

109.87.58.197 (talkcontribs)

How can I add php code to Wiki page? I need add php code to page or specify script as "action" in the html form. RawHtml enabled but php doesn't work.

MediaWiki 1.19.1 PHP 5.3.10-1ubuntu3.2 (apache2handler) MySQL 5.5.24-0ubuntu0.12.04.1

88.130.104.230 (talkcontribs)

I do not completely understand, what you want to do:

Do you want to display PHP code on one page in your wiki?

This works with the extension SyntaxHighlight_GeSHi. With it you can use <syntaxhighlight> tags on your page and place the PHP code inside:


<syntaxhighlight lang="php">
<?php 
//put your PHP code here ...
?>
</syntaxhighlight>

Or do you want to execute some PHP code, when a user of your wiki triggers a special action (like when he saves a page)?

This can be done using one of the hooks, which MediaWiki provides.

Reply to "php code in wiki"