Wiki source for DanWestIncludeFile

Show raw source

==What==>>==See Also==

~- FormattedIncludeAction - Includes other pages (vs files)
~- A basic include that will load a text file into the page.

~- Syntax: ##""{{include name='file.txt'}}""##
~- Includes the raw file in the output stream (Not safe HTML)

~- Put the following code into ##actions/includefile.php##

$file_name = $vars['name'];
if(isset($file_name)) {
if(is_readable($file_name)) {
if(isset($pre)) echo '<pre>';
if(isset($pre)) echo '</pre>';
} else {
echo "{{includefile}} File $fname not found";
} else {
echo 'usage: {{includefile <b><u>name</u></b>="<i>filename</i>"}} (Missing name)';

~- **Very Dangerous! - Caution**
~- **Not for a public Wiki since it can get __ANY__ file on the system. **
~- Can include PHP code too.

==To Do==
~- Lock it down to only a given sub-folder
~- Maybe pass it through safe HTML
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki