Loading custom HTML forms and PHP scripts into Moodle

Re: Loading custom HTML forms and PHP scripts into Moodle

by Mauno Korpelainen -
Number of replies: 0

For "normal use" of administrators and teachers the old trick is to use iframe tags. Embed the php script (or a web page using php) with tags like
<iframe src="path to your script" width="100%" height="580"></iframe>

Scripts inside iframe can also discuss with moodle - for example editor itself and most popups are just sending data (variables) between iframes or javascript windows and php files of moodle.

By default iframe tags are not allowed in such activities that students can use (user profile, forums,...) but IF you want to allow use of iframe tags (and php inside iframe) for students too you may add <iframe> to the list of allowed tags $ALLOWED_TAGS in lib/weblib.php

Tweaks like http://moodle.org/mod/forum/discuss.php?d=97830 are also possible but keep in mind that every user php script can be malicious and insecure php code is very simple to be hacked.