Hello, all!
I'm pleased to be the first to post a forum question on here. :)
I have a bit of an issue with the AutoURL code:
$test = ''; # clears the temp variable for each field
$test = $rec{$column}; # Assigns the field info to a temp variable
$test =~ s/<LI>/ /g;
$test =~ s/<([^>]|\n)*>//g; # Strip HTML codes out of the string
$test =~ m/([\w]+:\/\/[\w-?&;#~=\.\/]+[\w])/; # Finds the HTML line
$test = $1; # Assigns the temp variable to the matched HTML line
$rec{$column} =~ s/([\w]+:\/\/[\w-?&;#~=\.\/]+[\w])/<A HREF=\"$test\" target=\"new\">$1<\/A>/g;
$rec{$column} =~ s/(mailto:[\w-?@&;#~=\.\/]+[\w])/<A HREF=\"$1\" target=\"new\">$1<\/A>/gi;
}
Multiple URLs in my fields are rare, but not unheard-of. The first HTML link is perfect, going to the proper address. However, every address after that within the same field goes to the SAME address as the first rather than its own. I have tried a miriad of variations of this code to try to get around this shortcoming, but I'm at a total loss! Any ideas?
--Lee
I'm pleased to be the first to post a forum question on here. :)
I have a bit of an issue with the AutoURL code:
Code:
foreach $column (@db_cols) { $test = ''; # clears the temp variable for each field
$test = $rec{$column}; # Assigns the field info to a temp variable
$test =~ s/<LI>/ /g;
$test =~ s/<([^>]|\n)*>//g; # Strip HTML codes out of the string
$test =~ m/([\w]+:\/\/[\w-?&;#~=\.\/]+[\w])/; # Finds the HTML line
$test = $1; # Assigns the temp variable to the matched HTML line
$rec{$column} =~ s/([\w]+:\/\/[\w-?&;#~=\.\/]+[\w])/<A HREF=\"$test\" target=\"new\">$1<\/A>/g;
$rec{$column} =~ s/(mailto:[\w-?@&;#~=\.\/]+[\w])/<A HREF=\"$1\" target=\"new\">$1<\/A>/gi;
}
Multiple URLs in my fields are rare, but not unheard-of. The first HTML link is perfect, going to the proper address. However, every address after that within the same field goes to the SAME address as the first rather than its own. I have tried a miriad of variations of this code to try to get around this shortcoming, but I'm at a total loss! Any ideas?
--Lee