######################################################### # notepad.cgi # # written in 2002 by Jared Osborn, MVHS Sysop # # e-mail jaosborn@mbhs.edu to contact # # # # General Description: # # this script writes the user's information to the log, # # then calls the code for the notepad # ######################################################### #!/usr/bin/perl print "Content-type: text/html\n\n"; # Get Query Variables see parseform.pl for comments - taken from scatterplot.cgi $buffer = $ENV{"QUERY_STRING"}; @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($nume, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s///g; $query{$nume} = $value; } $user = $query{'user'}; $date = `date`; chomp($date); $topgraph = $query{'topgraph'}; $topstation = $query{'topstation'}; $topstationname = $query{'topstationname'}; $topfrom = $query{'topfrom'}; $topto = $query{'topto'}; $topyrange = $query{'topyrange'}; $topyrangeto = $query{'topyrangeto'}; $bottomgraph = $query{'bottomgraph'}; $bottomstation = $query{'bottomstation'}; $bottomstationname = $query{'bottomstationname'}; $botfrom = $query{'botfrom'}; $botto = $query{'botto'}; $botyrange = $query{'botyrange'}; $botyrangeto = $query{'botyrangeto'}; $topbmp = $query {'topbmp'}; $botbmp = $query {'botbmp'}; $done = $query {'done'}; open (LOGFILE,">>logfile"); #log file print LOGFILE "\n\n$user opened notepad at $date"; print LOGFILE "\nTop Station: $topstation $topstationname $topgraph x from $topfrom to $topto"; if($topyrange eq "" && $topyrangeto eq "") { print LOGFILE " y default"; } else { print LOGFILE " y from $topyrange to $topyrangeto"; } if($topbmp eq 1){ print LOGFILE " w/bmp"; } elsif($topbmp eq 0){ print LOGFILE " w/o bmp"; } print LOGFILE "\nBottom Station: $bottomstation $bottomstationname $bottomgraph x from $botfrom to $botto"; if($botyrange eq "" && $botyrangeto eq ""){ print LOGFILE " y default"; } else { print LOGFILE " y from $botyrange to $botyrangeto"; } if ($botbmp eq 1) { print LOGFILE " w/bmp"; } elsif ($botbmp eq 0) { print LOGFILE " w/o bmp"; } %assoc=("nitrogen",0, "phosphorus",1, "sediments",2, "heavymetal",3, "toxins",4, "watertemp",5, "temperature",6, "runoff",7, "precip",8, "ph",9, "do",10, "bod",11, "saturateddo",12, "totalflow",13, "groundwater",14); print "