Re: [PHP-DB] Text file (rw) question...
by Rob W. other posts by this author
Mar 14 2006 7:05PM messages near this date
Re: [PHP-DB] Text file (rw) question...
|
Re: [PHP-DB] Text file (rw) question...
Ah yes, that's true. I didnt realize that. Thanks for pointing that out.
----- Original Message -----
From: "Chris" <dmagick@[...].com>
To: "Rob W." <rob@[...].com>
Cc: <php-db@[...].net>
Sent: Tuesday, March 14, 2006 9:02 PM
Subject: Re: [PHP-DB] Text file (rw) question...
> Rob W. wrote:
> > It's all fixed and works. If anybody is wondering how this turned out,
> > here's the begining of the results.
> >
> > index.php
> >
> > <?php
> >
> > if (!($f=fopen("sc_serv.conf","r")))
> > exit("Unable to open file.");
> > while (!feof($f))
> > {
> > $x=fgets($f, 100);
> > list($variable, $data) = explode("=", $x);
> > echo "<form method=\"POST\" action=\"update.php\">";
> > if ($variable == "MaxUser") {
> > echo "Max Users: <input type=\"text\" value=\"$data\"
> > name=\"MaxUser\" size=\"3\"><br />";
> > }
> > if ($variable == "Password") {
> > echo "Password: <input type=\"text\" value=\"$data\"
> > name=\"Password\" size=\"15\"><br />";
> > }
> > // echo "$variable $data<br />";
> > }
> > fclose($f);
> >
> > echo "<p /><input type=\"SUBMIT\" value=\"Submit\" /></form>";
> >
> > ?>
> >
> > update.php
> >
> > <?
> >
> > $newconfig = "";
> >
> > $maxuser=$_POST['maxuser'];
> > $password=$_POST['password'];
>
>
> You're not using these variables anywhere so it'd be best to remove them
> (might be confusing later on if you need to come back to it).
>
> or you can leave them there and do:
>
> $newconfig = '';
> $newconfig .= "MaxUser=" . $maxuser . "\n";
> $newconfig .= "Password=" . $password . "\n";
>
> instead of the foreach($_POST... loop.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Rob W.
Rob W.
Chris
Rob W.
Rob W.
Rob W.
Chris
Rob W.
Chris
Rob W.
Chris
Rob W.
Chris
Peter Beckman
Rob W.
Chris
Dwight Altman
|