Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: inserting HTML formatting

Quote Reply
Re: inserting HTML formatting In reply to
I am confused by this thread. What do you do to get \n to be substituted to a <BR> tag?

I am trying to do it in admin.cgi under the sub add record so that when I add an article, the newlines are preserved when adding it from admin.

I have tried

$in->{Description} =~ s/\n/<BR>/g;

in
sub add_record {
# --------------------------------------------------------
# Adds a record to the database.
#
my ($in, $db) = @_;

# Fix up the category name.
($in->param('CategoryID') !~ /^\d+$/) and $in->param(-name => 'CategoryID', -value => &get_category_id($in->param('CategoryID')));

$in->{Article} =~ s/\n/<BR>/g;

my $id = $db->add_record (&cgi_to_hash($in), $in);
$id ? &html_add_success ($in, $db, $id) : &html_add_failure ($in, $db, $Links: BSQL::error);
}

Of course I get software error.

Thanks, Kevin
Subject Author Views Date
Thread inserting HTML formatting rholmin 13587 Nov 7, 1999, 7:47 PM
Post Re: inserting HTML formatting
Alex 13383 Nov 7, 1999, 9:20 PM
Post Re: inserting HTML formatting
Digital Concepts 13392 Nov 7, 1999, 10:06 PM
Post Re: inserting HTML formatting
rholmin 13419 Nov 8, 1999, 7:07 AM
Post Re: inserting HTML formatting
pugdog 13393 Nov 8, 1999, 10:42 AM
Post Re: inserting HTML formatting
rholmin 13382 Nov 8, 1999, 5:04 PM
Post Re: inserting HTML formatting
rholmin 13407 Nov 8, 1999, 5:14 PM
Post Re: inserting HTML formatting
Alex 13405 Nov 8, 1999, 7:23 PM
Post Re: inserting HTML formatting
rholmin 13410 Nov 9, 1999, 7:17 PM
Post Re: inserting HTML formatting
hostglobal 13394 Dec 7, 1999, 5:14 PM
Post Re: inserting HTML formatting
hostglobal 13400 Dec 7, 1999, 5:33 PM
Post Re: inserting HTML formatting
Alex 13395 Dec 9, 1999, 4:16 PM
Thread Re: [rholmin] inserting HTML formatting
cdkrg 13250 Oct 5, 2003, 9:54 PM
Thread Re: [cdkrg] inserting HTML formatting
Andy 13282 Oct 6, 2003, 1:21 AM
Post Re: [Andy] inserting HTML formatting
cdkrg 13259 Oct 6, 2003, 1:27 AM