Hi Alex,
I got an error message with <%custom_form%> :
Code:
A fatal error has occured:
Unable to compile 'custom_form'. Reason: syntax error at (eval 8) line 42, near "}
.."
syntax error at (eval 8) line 46, near "}
open "
syntax error at (eval 8) line 50, near ";
}"
Please enable debugging in setup for more details.
Below is my code for 'custom_form':
Code:
sub {
my $tags = shift;
my $query = $tags->{query};
my ($full_name) = $DB->table('Category')->select(['Full_Name'], { ID => $tags->{ID} })->fetchrow;
my $file = '';
if ($full_name =~ /^Announcements/) {
$file = 'add_announ.html';
}
elsif ($full_name =~ /^Automobiles/) {
$file = 'add_auto.html';
}
elsif ($full_name =~ /^Business_Opportunities/) {
$file = 'add_buss.html';
}
elsif ($full_name =~ /^Collectibles/) {
$file = 'add_collect.html';
}
elsif ($full_name =~ /^Computers___Software/) {
$file = 'add_computer.html';
}
elsif ($full_name =~ /^Employment/) {
$file = 'add_employ.html';
}
elsif ($full_name =~ /^General_Merchandise/) {
$file = 'add_general.html';
}
elsif ($full_name =~ /^Lost___Found/) {
$file = 'add_lost.html';
}
elsif ($full_name =~ /^Personals/) {
$file = 'add_personal.html';
}
elsif ($full_name =~ /^Professional_Services/) {
$file = 'add_services.html';
}
elsif ($full_name =~ /^Real_Estate/) {
$file = 'add_real.html';
}
elsif ($full_name =~ /^Rentals___Roommates/) {
$file = 'add_rental.html';
}
..
else {
$file = 'include_form.html';
}
open (FILE, "/home/worldbar/public_html/db/cgi-bin/admin/templates/default/$file");
read (FILE, my $data, -s FH);
close FILE;
return $data;
}
Please help and thank you so much.