| 
<?php
/**
 File: parameters.php
 Description:
 example of interaction with clsparameters.php
 
 ***/
 
 
 $ini_file = "parameters.ini";
 
 include_once ("clsini.php");
 
 if (isset($_POST['action'])) $actie = $_POST['action'];
 
 echo "<p>Example INI tool</p>";
 
 
 switch ($actie) {
 case "save" :
 $objINI->edit($_POST);
 $objINI->save();
 echo "INI-file updated.<br>";
 break;
 case "add":
 $section = $_POST['section'];
 $name = $_POST['name'];
 $value = $_POST['value'];
 set_ini_parameter($name, $value, $section); // example to store a new parameter
 echo "Parameter added.<br>";
 break;
 }
 echo "example of retrieveing parameters all through your project : max_number_files_tmpdir = ". get_ini_parameter("max_number_files_tmpdir")."<br><br><br>";
 
 echo $objINI->editform();
 echo $objINI->addform();
 
 echo "<hr>Display content of inifile <br><pre>";
 $s = readfile ($ini_file); // display content of ini_file.
 
 echo "</pre>";
 echo "<hr>Check content of inifile using regular php-command (parse_ini_file())<br><pre>";
 print_r(parse_ini_file ($ini_file)); // display content of ini_file.
 echo "</pre>";
 
 
 
 ?>
 |