Help with Line Breaks from webform

Help with Line Breaks from webform

am 26.08.2004 20:43:47 von dsdavis

Hi,

I have a web app that users use to submit information about the courses
they're teaching. They can either enter text into the textarea fields
manually, or by copying and pasting from another source (usually a =
Microsoft
Word document). When they submit the form, a Perl program inserts the =
data
into a MySQL table. But when I later issue a select command and get the
data out of the MySQL table to display on a webpage, the line breaks are
gone. What do I need to do so that the data remains formatted the way =
it is
when it's entered into the webform? =20




Douglas =20


--------------------------------------
Douglas S. Davis
Programmer/Analyst
Haverford College
Department of Administrative Computing
370 Lancaster Ave.
Haverford, PA 19041
610-896-4206
dsdavis@haverford.edu
http://www.haverford.edu=20



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

Re: Help with Line Breaks from webform

am 26.08.2004 20:56:54 von Mayuran

Douglas S. Davis wrote:

>Hi,
>
>I have a web app that users use to submit information about the courses
>they're teaching. They can either enter text into the textarea fields
>manually, or by copying and pasting from another source (usually a Microsoft
>Word document). When they submit the form, a Perl program inserts the data
>into a MySQL table. But when I later issue a select command and get the
>data out of the MySQL table to display on a webpage, the line breaks are
>gone. What do I need to do so that the data remains formatted the way it is
>when it's entered into the webform?
>
>
>
>
> Douglas
>
>
>--------------------------------------
>Douglas S. Davis
>Programmer/Analyst
>Haverford College
>Department of Administrative Computing
>370 Lancaster Ave.
>Haverford, PA 19041
>610-896-4206
>dsdavis@haverford.edu
>http://www.haverford.edu
>
>
>
>
>
What kind of field are you storing the data into ? I was doing something
similar and in order
to get the linbreaks back by replacing the newline character with
.

Ex:
my $sth = $dbh->prepare (q{ SELECT summary FROM summary WHERE id = ?});
$sth->execute ($cgi->param('id'));
$sth->bind_columns (\my $summary);
$sth->fetch();

$summary =~ s/\n/
/g;

Hope that helps,
Mayuran


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Help with Line Breaks from webform

am 26.08.2004 20:56:54 von Mayuran

Douglas S. Davis wrote:

>Hi,
>
>I have a web app that users use to submit information about the courses
>they're teaching. They can either enter text into the textarea fields
>manually, or by copying and pasting from another source (usually a Microsoft
>Word document). When they submit the form, a Perl program inserts the data
>into a MySQL table. But when I later issue a select command and get the
>data out of the MySQL table to display on a webpage, the line breaks are
>gone. What do I need to do so that the data remains formatted the way it is
>when it's entered into the webform?
>
>
>
>
> Douglas
>
>
>--------------------------------------
>Douglas S. Davis
>Programmer/Analyst
>Haverford College
>Department of Administrative Computing
>370 Lancaster Ave.
>Haverford, PA 19041
>610-896-4206
>dsdavis@haverford.edu
>http://www.haverford.edu
>
>
>
>
>
What kind of field are you storing the data into ? I was doing something
similar and in order
to get the linbreaks back by replacing the newline character with
.

Ex:
my $sth = $dbh->prepare (q{ SELECT summary FROM summary WHERE id = ?});
$sth->execute ($cgi->param('id'));
$sth->bind_columns (\my $summary);
$sth->fetch();

$summary =~ s/\n/
/g;

Hope that helps,
Mayuran


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Help with Line Breaks from webform

am 26.08.2004 20:59:00 von Mayuran

Mayuran Yogarajah wrote:

> Douglas S. Davis wrote:
>
>> Hi,
>>
>> I have a web app that users use to submit information about the courses
>> they're teaching. They can either enter text into the textarea fields
>> manually, or by copying and pasting from another source (usually a
>> Microsoft
>> Word document). When they submit the form, a Perl program inserts
>> the data
>> into a MySQL table. But when I later issue a select command and get the
>> data out of the MySQL table to display on a webpage, the line breaks are
>> gone. What do I need to do so that the data remains formatted the
>> way it is
>> when it's entered into the webform?
>>
>>
>>
>> Douglas
>>
>> --------------------------------------
>> Douglas S. Davis
>> Programmer/Analyst
>> Haverford College
>> Department of Administrative Computing
>> 370 Lancaster Ave.
>> Haverford, PA 19041
>> 610-896-4206
>> dsdavis@haverford.edu
>> http://www.haverford.edu
>>
>>
>>
>>
> What kind of field are you storing the data into ? I was doing
> something similar and in order
> to get the linbreaks back by replacing the newline character with
.
>
That should read: I was doing something similar and in order to get the
linebreaks back I had to
replace the newline character with
. Sorry :P

> Ex:
> my $sth = $dbh->prepare (q{ SELECT summary FROM summary WHERE id = ?});
> $sth->execute ($cgi->param('id'));
> $sth->bind_columns (\my $summary);
> $sth->fetch();
>
> $summary =~ s/\n/
/g;
>
> Hope that helps,
> Mayuran
>
>


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Help with Line Breaks from webform

am 26.08.2004 20:59:00 von Mayuran

Mayuran Yogarajah wrote:

> Douglas S. Davis wrote:
>
>> Hi,
>>
>> I have a web app that users use to submit information about the courses
>> they're teaching. They can either enter text into the textarea fields
>> manually, or by copying and pasting from another source (usually a
>> Microsoft
>> Word document). When they submit the form, a Perl program inserts
>> the data
>> into a MySQL table. But when I later issue a select command and get the
>> data out of the MySQL table to display on a webpage, the line breaks are
>> gone. What do I need to do so that the data remains formatted the
>> way it is
>> when it's entered into the webform?
>>
>>
>>
>> Douglas
>>
>> --------------------------------------
>> Douglas S. Davis
>> Programmer/Analyst
>> Haverford College
>> Department of Administrative Computing
>> 370 Lancaster Ave.
>> Haverford, PA 19041
>> 610-896-4206
>> dsdavis@haverford.edu
>> http://www.haverford.edu
>>
>>
>>
>>
> What kind of field are you storing the data into ? I was doing
> something similar and in order
> to get the linbreaks back by replacing the newline character with
.
>
That should read: I was doing something similar and in order to get the
linebreaks back I had to
replace the newline character with
. Sorry :P

> Ex:
> my $sth = $dbh->prepare (q{ SELECT summary FROM summary WHERE id = ?});
> $sth->execute ($cgi->param('id'));
> $sth->bind_columns (\my $summary);
> $sth->fetch();
>
> $summary =~ s/\n/
/g;
>
> Hope that helps,
> Mayuran
>
>


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org