2 $e_all = defined('E_DEPRECATED') ? E_ALL
& ~E_DEPRECATED
: E_ALL
;
3 error_reporting($e_all);
4 ini_set('display_errors', 1);
6 require_once('../config/global_config.php');
7 $all_vars = get_defined_vars();
8 $contents = file_get_contents('../config/config.template.php');
9 $contents = str_replace('<?php', '', $contents);
10 $contents = str_replace('?>', '', $contents);
11 $search = '~\[(\w+?)\]~';
12 $contents = preg_replace_callback($search, 'make_input', $contents);
21 function make_input($matches)
24 $my_var = (in_array($matches[1], array_keys($all_vars))) ?
$all_vars[$matches[1]] : '';
25 $replace = '<input name="' . $matches[1] . '" value="' . $my_var . '" />';
29 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
30 <html xmlns
="http://www.w3.org/1999/xhtml">
32 <title
>Program O
Global Config File Editor
</title
>
33 <style type
="text/css">
50 <h3
>Program O Config File Editor
</h3
>
52 Use this (somewhat unconventional
) form to edit your chatbot
's confituration
53 file directly. Only the settings that you <strong>should</strong> need to change are
54 available here. If you need to change other settings, then you'll need to
55 make those changes in a text editor
.
57 <form name
="config" action
="config_edit.php">
61 <?php
echo $contents ?
>
65 <div id
="save_btn"><input type
="submit" name
="save" value
="Save" /></div
>