If replacing " characters for output to html, don't replace them with ''
(two single quotes), replace with the magic value " (including
the semicolon), which is a special html entity that means "put a
quotation mark here"

Search google for html entities for more.

Gfunk         -          http://www.gfunk007.com/

I sense much beer in you. Beer leads to intoxication, intoxication to
hangovers, and hangovers to... suffering.


----- Original Message -----
From: "Anna" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 11, 2001 11:36 AM
Subject: Re: [PHP] my bugaboo.


> ----- Original Message -----
> From: "Floyd Baker" <[EMAIL PROTECTED]>
>
>
> >
> > Hello and thanks to all for the help on the magic quotes, etc.
> > It gives me a better handle on what I'm dealing with.
> >
> > Except for one more thing.
> >
> > When I bring back text from a field which contains a ', and try to apply
> it as
> > the value of an input box, it still truncates in the box.
> >
> > When I simply print $text, it prints out correctly as *Don't do this* .
> > When I make $text the default value of an input box, it shows as *Don*.
> >
> > If the slash is still in place, it reads *Don\'t* above the box and
*Don\*
> in
> > the box.
> >
> > My bugaboo continues..  :->
> >
> > Thanks again for any further advice.
> >
> > Floyd
> >
>
> That's  a problem with HTML.
> example:
> <input type='text' name='textName' value='Don't do this'>
> Sees the ' in Don't as the signal for the end of the value string.
> I haven't come up with an automatic way to deal with this,
> but what I have done is in these lines (where there might be an
apostrophe)
> make sure I use double quotes:
> <input type="text" name="textName" value="Don't do this">
> or
> print "<input type=\"text\" name=\"textName\" value=\"Don't do this\">";
>
> Of course, then you may have the same trouble with double quotes. To avoid
> that you can do ereg_replace("\"", "''", $text) -- that is, replace a
double
> quote with two single quotes? I think, I've never bothered.
>
> Hope this helps somehow.
>
> Anna
>
>
> --
> 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]
>


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