Dan,

Thanks for replying so fast.. I tried it out right away.

The script part of it didn't seem to give me much grief, however the html
part of it seems to be having issues
with the combination of single quotes (') and double qouotes ("), or maybe
it's the order, or a linebreak in the email... i don't know...

<?
print '<INPUT TYPE="TEXT" NAME="savings" VALUE="' .
$data["SAVINGS"] . "'>";
?>

--------
Also this solution provides a text box... I'm sure I can play around with
making it an 'option' within a 'select' item of a form... like:

<?
print "<select size="1" name="SAVINGS">"
print "<option name="SAVINGS" VALUE="foo">";
?>

please lemme know if i'm understanding this right...
thanks

-Alex

"Daniel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Alex-
>
> This is very basic PHP.
>
> > I have some variables stored in plain text in a text file. Unfortunately
I
> > am not going to be able to use SQL to solve this one, since that server
is
> > not running it. Anyway.
> >
> > The text file looks like this (everything between the *):
> > *
> > SAVINGS=type1
> > FILTER=disabled
> > SPOOL=category1
> > *
> >
> > I use a form to edit this text file. SAVINGS and SPOOL are 'select' form
> > items with multiple options. FILTER is a 'radio' form item with two
options.
> >
> > I was wondering if anyone knew how to make the text file pass the
variables
> > into the form that i use to edit the text file... confusing?
>
> First, you need to get the data from the file and make the items
> useful:
>
> <?
> $ary = file("myfile.file");
>
> foreach($ary as line) {
>   # break up the line
>   list($key,$value) = explode("=",$line);
>
>   # Take off that pesky newline
>   $value = substr($value,0,-1);
>
>   $data[$key]=$value;
> }
> ?>
>
> Now your values are accessible as $data["SAVINGS"], etc.
>
> So... when building the HTML...
>
> <?
> print '<INPUT TYPE="TEXT" NAME="savings" VALUE="' .
> $data["SAVINGS"] . "'>";
> ?>
>
>
>
> Daniel J. Lashua
>



-- 
PHP General 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]

Reply via email to