I posted this is the DBMan forum but since there isn't much activity from responders these days I'm hoping someone here can help me.
I'm using a little sub that extracts related records for the database and creates a list.
The sub is called from within my page display as:
print &other_title_link("$rec{'Title'}", "6"); (which is defining: print &other_field_link("$value", "$field_num"); )
The script works great for creating the lists unless the Title field contains and "&" and then no list is generated :(
Not being a programmer I've tried several attempts to get those records to display, but failed.
How can I get the script to convert the & to & or whatever it takes for the script to pull in and display those records.
sub other_title_link {
#----------------------------------------
## this displays related subtitles listed on static pages
my $value = shift;
my $field_num = shift;
my $link;
open (DB, "<$db_file_name") || &cgierr("Can't open $db_file_name in other_field_link: $!");
while (my $line = <DB>) {
chomp($line);
my @line = &split_decode($line);
next unless ($line[2] eq 'Yes'); ## Validate field
if ($line[$field_num] eq "$value") {
if ($line[7] ne "") { ## show only if there is a subtitle
$link .= qq|<A HREF="$db_script_link_url&Title=$line[6]&subtitle=$line[7]&ww=1&view_records=1">$line[7]</A><BR>|;
}
}
}
close (DB);
if ($link) {
return ('All Titles on this page:<P>' . $link . '<P>') };
}
Since some records have the same title but different subtitles, I modified the script to just display the subtitles in the list which is $line[7].
Any help would be greatly appreciated :)
Unoffical DBMan FAQ
http://creativecomputingweb.com/dbman/index.shtml/
I'm using a little sub that extracts related records for the database and creates a list.
The sub is called from within my page display as:
print &other_title_link("$rec{'Title'}", "6"); (which is defining: print &other_field_link("$value", "$field_num"); )
The script works great for creating the lists unless the Title field contains and "&" and then no list is generated :(
Not being a programmer I've tried several attempts to get those records to display, but failed.
How can I get the script to convert the & to & or whatever it takes for the script to pull in and display those records.
sub other_title_link {
#----------------------------------------
## this displays related subtitles listed on static pages
my $value = shift;
my $field_num = shift;
my $link;
open (DB, "<$db_file_name") || &cgierr("Can't open $db_file_name in other_field_link: $!");
while (my $line = <DB>) {
chomp($line);
my @line = &split_decode($line);
next unless ($line[2] eq 'Yes'); ## Validate field
if ($line[$field_num] eq "$value") {
if ($line[7] ne "") { ## show only if there is a subtitle
$link .= qq|<A HREF="$db_script_link_url&Title=$line[6]&subtitle=$line[7]&ww=1&view_records=1">$line[7]</A><BR>|;
}
}
}
close (DB);
if ($link) {
return ('All Titles on this page:<P>' . $link . '<P>') };
}
Since some records have the same title but different subtitles, I modified the script to just display the subtitles in the list which is $line[7].
Any help would be greatly appreciated :)
Unoffical DBMan FAQ
http://creativecomputingweb.com/dbman/index.shtml/