From 85af10f3a6e4a17293c35c182353aa868c9a7298 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Thu, 8 Dec 2022 17:21:50 +0100 Subject: [PATCH] add inc_functions --- public_html/inc_functions.php | 17 +++++++++++++++++ public_html/index.php | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 public_html/inc_functions.php diff --git a/public_html/inc_functions.php b/public_html/inc_functions.php new file mode 100644 index 0000000..84531e3 --- /dev/null +++ b/public_html/inc_functions.php @@ -0,0 +1,17 @@ +<?php + +function showExample($sPhpcode){ + global $renderAdminLTE; + $sOut = ''; + + eval("\$sOut=$sPhpcode;"); + + return ' + <h3>PHP code</h3> + <pre>'.htmlentities($sPhpcode).'</pre> + + <h3>Output</h3> + '.$sOut.' + + '; +} \ No newline at end of file diff --git a/public_html/index.php b/public_html/index.php index b1efc48..308c85d 100755 --- a/public_html/index.php +++ b/public_html/index.php @@ -3,6 +3,8 @@ require_once('classes/render-adminlte.class.php'); require_once('classes/pageinclude.class.php'); +require_once('inc_functions.php'); + // ---------------------------------------------------------------------- // CONFIG // ---------------------------------------------------------------------- -- GitLab