Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I am trying to perform substitutions on the text that has been submitted from an HTML form using the TEXTAREA element.
In my HTML I have a TEXTAREA element named info and I try to do the following in the called Perl script:
... my $info = $query->param('info'); $info =~ s/\n/<p>/g; my $sql = sprintf "insert into test values(%s)", $dbh->quote($info); $dbh->do($sql) || die; ...
However, when I submit
to the HTML form, I see:Hello, This is a test. Bye Bye.
in the database.test=> select * from test; stuff ----------------------------------------------- <p>Bye Bye.a test. (1 row)
Why?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replacing new line characters from HTML TEXTAREA submissions
by dvergin (Monsignor) on Mar 14, 2001 at 15:30 UTC | |
by Anonymous Monk on Mar 16, 2001 at 15:32 UTC | |
|
Re: Replacing new line characters from HTML TEXTAREA submissions
by jlawrenc (Scribe) on Mar 14, 2001 at 21:12 UTC | |
by dvergin (Monsignor) on Mar 15, 2001 at 01:39 UTC | |
|
Re: Replacing new line characters from HTML TEXTAREA submissions
by dws (Chancellor) on Mar 15, 2001 at 00:14 UTC |