Wow, I'll try it!  I don't think someone will put extra info into the cell,
but you never know.
Thanks,
Hugh
----- Original Message -----
From: James Holloway <[EMAIL PROTECTED]>
To: Hugh Danaher <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 7:11 AM
Subject: Re: Need help on putting variable into <form>


> Hi Hugh,
>
> Most of your questions have been answered, but I thought you might also
like
> to consider this:
>
> htmlentities() and htmlspecialchars()
>
> If someone uses " or > in your variable, it might mess your form up:
>
> print "<input type=\"text\" size=\"30\"
> name=\"comp_name\" value=\"$comp_name\">";
>
> If they type ABC Company "The Best"
>
> it becomes:
> print "<input type=\"text\" size=\"30\"
> name=\"comp_name\" value=\"ABC Company \"The Best\"\">";
>
> ^^^^^^^^^^
>
> The form interprets the " before "The Best" as the end of the value for
that
> field.
>
> Using
> print "<input type=\"text\" size=\"30\"
> name=\"comp_name\" value=\"" . htmlentities($comp_name) . "\">";
>
> will cure any woes ;)
>
> http://www.php.net/manual/en/function.htmlspecialchars.php
> http://www.php.net/manual/en/function.htmlentities.php
>
> James
>
> ----- Original Message -----
> From: "Hugh Danaher" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> To: "Php-General" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 28, 2001 4:27 AM
> Subject: Need help on putting variable into <form>
>
>
> Help.  I have a page with a form with lots of text boxes which can be
filled
> with data from a text file.  the fopen() and fgets() works, and the text
> boxes which require numbers have no problems.  But, I have text boxes
which
> require several words of text and they refuse to work right.  The first
word
> makes it in the box, but the rest of the words are lost.
>
> As an example, the data file contains:  ABC Company, Inc. in the spot for
> $comp_name.  If I call for this variable elsewhere outside of a text box,
it
> prints in full, but when used by the following, it prints only: ABC
>
> print "<input type=text size=30 name=comp_name value=$comp_name>";
>
> There must be something blindingly obvious that I'm missing.  Please help.
> Thanks, Hugh
>
>
>
>


-- 
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