#!/usr/bin/perl #------------------------------------------------------------------------------- # Copyright (c) 2001, Space Radiation Lab (SRL), #  California Institute of Technology. All rights reserved. # Unauthorized reproduction prohibited. #------------------------------------------------------------------------------- # Author: Glenn R. Hamell # Filename: filename # Revision: 1.0 # Orig Date: 2001 Mar 23 # Last Mod: 2001 Mar 23 #+------------------------------------------------------------------------------ # Module: (module filename) # # Purpose: # # Procedures: (one line per procedure name within the module, followed by a # brief description of the procedure.) # # Calling Sequence: (The calling sequence line shall contain the methods # in which module can be called from other programs. # Options & arguments shall be described along with any data types.) # # Inputs: # # Outputs: # # Keywords: # # Returns: (for Function only) # # History: # 2001 Mar 23 GRH # Created. #------------------------------------------------------------------------------- use CGI qw(:standard); $q = new CGI; # Get params print header; print start_html(-title=>'GCR Spectra', -bgcolor=>'#000000', -background=>'/images/spacback.gif', -text=>'#CCFFFF', -link=>'#CCFFCC'), '
', '', '', 'ACE logo ', '', '', 'ASC logo ', '', h1('Calculated GCR Spectra'), p, 'ACE Science Center', '', '
', br, p; print 'Entered the display_data module',br; print 'param("phi")=',param('tgt_phi'),br; if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); print 'QUERY_STRING=',$ENV{'QUERY_STRING'},br; } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); print 'CONTENT_LENGTH=',$ENV{'CONTENT_LENGTH'},br; } else { print "Content-type: text/html\n\n"; print "

Use Post or Get"; } print 'End of IFs',br; foreach $pair (@pairs) { print '$pair=',$pair,br; ($key, $value) = split (/=/, $pair); $key =~ tr/+/ /; $key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~s///g; if ($formdata{$key}) { $formdata{$key} .= ", $value"; } else { $formdata{$key} = $value; } } print 'End of FOREACH',br; print 'Last index of PAIRS=',$#pairs,br; while ( ($k, $v ) = each (%formdata) ) { print $k,' ', $v, br; } ################# END OF RoutineName #########################