my @files = <../data/text/*.txt>; my @display_files = map /([^\/]+)\.txt/, @files; Encode::from_to($_, "ISO-8859-7", "utf8") for @display_files; print br; print start_form( action=>'index.pl' ); print h1( {class=>'lime'}, "Επέλεξε το κείμενο που σε ενδιαφέρει => ", popup_menu( -name=>'select', -values=>\@display_files ), submit('Εμφάνιση')); print end_form; my $passage = param('select') || "Αρχική Σελίδα!"; Encode::from_to($passage, "utf8", "ISO-8859-7") if param(); if ( param('select') ) { unless ( $passage =~ /^[a-zA-Zα-ωΑ-Ω0-9]+$/ ) { print br() x 2; print h1( {class=>'big'}, "*Backward Directory Traversal* hack will NOT help you here, Mighty Lamer!" ); exit; } open(FILE, "<../data/text/$passage.txt") or die $!; local $/; $data = ; close(FILE); Encode::from_to($passage, "ISO-8859-7", "utf8"); $select = $dbh->prepare( "UPDATE guestlog SET passage=?, date=?, counter=counter+1 WHERE host=?" ); $select->execute( $passage, $date, $host ); } else