[FX.php List] Displaying & Updating comments
Joel Shapiro
jsfmp at earthlink.net
Wed Jul 19 13:21:18 MDT 2006
Hi AC
What about if you add in "</B>" (without quotes) after the Comment
field, as such:
<? echo('<P><FONT SIZE="+1">' . $ResultOne['Comment'][0] . '</B></
FONT></P>' . "\r\n"); ?>
I haven't tried this, but I'm thinking that this way you would be
ending whatever bold command has been added within the comment. I
would think that a stray </B> won't break anything if there's no
starting <B> (even though it might not be the 'cleanest' thing to do).
HTH
-Joel
Joel Shapiro - FileMaker Pro Database Design
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
joelshapiro at jsfmp dot com
http://www.jsfmp.com
415-269-5055
On Jul 18, 2006, at 10:29 AM, AC wrote:
> Sorry if this screws something up, I had to copy it from the
> website and then e-mail it.
>
> I'm not sure what you mean by "Real the sample that is in FX.zip?"
> If you're asking if I can update regular text fields the answer is
> yes.
> Am I using the latest copy of FX, yes.
> Are you saying there's a sample file in the FX folder that shows
> how to display & update a comment field that may contain HTML code,
> if so could you tell which file specifically?
> If you're suggesting that I should read the documentation that came
> with FX, I have.
>
> Just to clarify my problem, when I use the command
> <? echo('<P><FONT SIZE="+1">' . $ResultOne['Comment'][0] . '</
> FONT></P>' . "\r\n"); ?>
> and the comment includes text like "<B>" it turns all text after it
> to bold.
>
> I used the htmlentities() & str_replace() which fixed the problem
> for display purposes, however I can't seem to get this to work for
> updating records.
> If the user types
> a'a"a\a
> into the comment field, then the database will contain the text
> a\'a\"a\\a
>
> I tried using
> $Search->AddDBParam('Comment', str_replace('\\\\', '\\', str_replace
> ('\"', '"', str_replace("\'", "'", $_REQUEST['Comment']))));
> which works unless a user uses the funny single or double quotes.
> I assume there's an easier way to do this and I was hoping someone
> could point me in the right direction.
>
>
>
>
>
> ggt667 at gmail.com wrote:
> Real the sample that is in FX.zip?
>
> ggt667
>
> On 7/18/06, AC <ac at pottnerconsulting.ca> wrote:
> > I'm fairly new to FX, PHP and HTML.
> > I need to do the following with a comments field;
> > - display it on the web
> > - pass it as a hidden value to be entered into the database
> > - pre-populate a textarea with it again to be put into the
> database
> >
> > If I just display the comments then text like" <B>" makes the
> rest of
> > the characters that follow bold.
> > I tried htmlentities() which worked but gave me "”" instead
> of a
> > quote.
> > Now I'm using str_replace() to substitute the text "”" back
> to a
> > quote.
> > My problem with this is it still doesn't cover things like multiple
> > spaces and carriage returns.
> > I also have issues when a user enters weird quotes, I can't seem to
> > write those to the database at all.
> >
> > How should I be doing this?
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list