Fair enough. I might ahve thought of that, but ... ??
> It's how you've passed the path to it that's the problem.
> Try t:/cd/test.ini instead of t:\cd\test.ini. If you insist on using the
> latter form, you need to escape the \ as \\ so it reads t:\\cd\\test.ini
> I think I have found a bug with cIniFileReader.inc (Fresh
> download today from:
> http://phpclasses.upperdesign.com/browse.html/package/204
So I used this code below.
It still will not read any Sections, Keys or Values. And again, when I click to
add a key/value pair, it empties out the file leaving it 0 bytes, and I still
get this error: "Warning: Undefined variable: OS in
E:\cd\library\classes\cIniFileReader.inc on line 161".
:( John
<?
require($DOCUMENT_ROOT."\\library\\headers\\hIniFileReader.inc");
echo $DOCUMENT_ROOT."\\test.ini";
if (isset($GetValue)) {
$ini = new IniFileReader($DOCUMENT_ROOT."\\test.ini");
$tmp = $ini->getIniFile($section, $key, "This is the default value");
$tmp = "Value retrieved from the ini file for key ($key): " . $tmp;
} elseif (isset($GetAllSections)) {
$ini = new IniFileReader($DOCUMENT_ROOT."\\test.ini");
$tmp = $ini->sections();
$tmp2 = "<center><table border=1><tr><td>The Sections Returned</td></tr>";
while (list($key, $sec) = each($tmp)) {
$tmp2 .= "<tr><td>$sec</td></tr>";
}
$tmp2 .= "</table></center>";
$tmp = $tmp2;
} elseif (isset($GetAllKeys)) {
$ini = new IniFileReader($DOCUMENT_ROOT."\\test.ini");
$tmp = $ini->keys($section);
$tmp2 = "<center><table border=1><tr><td>The Keys Returned For Section
$section</td></tr>";
while (list($key, $val) = each($tmp)) {
$tmp2 .= "<tr><td>$val</td></tr>";
}
$tmp2 .= "</table></center>";
$tmp = $tmp2;
} elseif (isset($SetValue)) {
$ini = new IniFileReader($DOCUMENT_ROOT."\\test.ini");
$tmp = $ini->setIniFile($section, $key, $value);
$tmp = "The file was successfully updated: " . ($tmp ? "True" : "False");
}
?>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]