#!/usr/local/bin/perl
#
#use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);

&readparse;
print "Content-type: text/html\n\n";
#
#********* BEGIN BODY********************

system("perl MAKE_RUN_INFO_HTML.pl ALL");

$runinfoplace = "../../../doc/RUN_INFO/ldc2";

print "<html>\n<head>\n";
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=$runinfoplace/RUN_INFO_ALL.html\">\n";
print "</head>\n";
print "<body bgcolor=\"#0000b0\" text=\"white\" link=\"yellow\" vlink=\"ff9900\">";

print "Redirecting to Run Info page (All runs)...";

print "</body>\n</html>\n";




#******** END BODY************************
#
# EACH VALUE IN THE HTML FORM WILL BE CONTAINED IN
# THE THE @VALUE ARRAY.
sub readparse {
    read(STDIN,$user_string,$ENV{'CONTENT_LENGTH'});
    if (length($ENV{'QUERY_STRING'})>0) {$user_string=$ENV{'QUERY_STRING'}};
    $user_string =~ s/\+/ /g;
    @name_value_pairs = split(/&/,$user_string);
    foreach $name_value_pair (@name_value_pairs) {
	($keyword,$value) = split(/=/,$name_value_pair);
	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/ge;
	push(@value, "$value");
	$user_data{$keyword} = $value;
	if ($value=~/<!--\#exec/) {
	    print "Content-type: text/html\n\nNo SSI permitted";
	    exit;
	};
    };
};


