#!/perl/bin/perl use strict; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use DBI; my $q = new CGI; print header(); #print "Test"; my $userip = $ENV{'REMOTE_ADDR'}; #print $userip; my $curr_dir; #print $userip; # Grab the current directory from $0. BEGIN { $0 =~ '(.*[\\\/])\w+\.\w+$'; $curr_dir = $1 || "./"; } my $display = &filter($q->param('display')) || ''; my $insert = &filter($q->param('insert')) || ''; my $confir = &filter($q->param('confir')) || ''; my %AoH; if($insert eq "insert"){ $AoH{MESS} = "OK your message has been received!"; }else{ $AoH{MESS} =""; } print "
I must to print these values here once the buttons on the form has been clicked:
***INSERT=$insert******DISPLAY=$display******CONFIR=$confir######
"; my $out_file; $out_file = "${curr_dir}table.html"; open(OUTPUT, "$out_file") || print "L40 - There is no file here, I'll run away now!"; while() { $_=~s//$AoH{MESS}/g; print $_; } close OUTPUT; ####################################### ### Filter - Gets rid of characters that screw up the program. sub filter { if($_[0]){ $_[0]=~s/\s+$//; $_[0]=~s/\'/\\\'/g; $_[0]=~s///g; $_[0]=~s/;//g; $_[0]=~s/\(//g; $_[0]=~s/\)//g; $_[0]=~s/\"//g; $_[0]=~s/\'//g; $_[0]=~s/\?//g; $_[0]=~s/\