can't find previous post about this but i had a mod that was making a href and storing in the database. i now prefer to store the data without the html tags, then add the tags when i'm reading and printing the record.
this is the code i used before:
$text =~ s/\b(http:\/\/\S+[^-.,\"\';: ])\b/<a href="$1">$1<\/a>/g;
that worked, and the href stuff was written to file. now that is not written to the file. here's the code that reads the file and i'm trying to add the tags before printing but they're not being added:
@text = <TEXT>;
close TEXT;
$text = join "",@text;
$text =~ s/\b(http:\/\/\S+[^-.,\"\';: ])\b/<a href="$1">$1<\/a>/g;
print $text;thanks!
this is the code i used before:
$text =~ s/\b(http:\/\/\S+[^-.,\"\';: ])\b/<a href="$1">$1<\/a>/g;
that worked, and the href stuff was written to file. now that is not written to the file. here's the code that reads the file and i'm trying to add the tags before printing but they're not being added:
Code:
open (TEXT, "<$save_text_dir/$rec{$db_key}.txt") or &cgierr("error in displaying record. unable to open text file $save_text_dir/$rec{$db_key}.txt\nReason: $!"); @text = <TEXT>;
close TEXT;
$text = join "",@text;
$text =~ s/\b(http:\/\/\S+[^-.,\"\';: ])\b/<a href="$1">$1<\/a>/g;
print $text;