#!/bin/perl ##################################################################### # Global Constants ##################################################################### require "flush.pl"; $StartupDir = `pwd`; chop $StartupDir; $ExdasyDir = "$StartupDir/Exdasy"; $ISISDir = "$StartupDir/isis"; $BinDir = "$StartupDir/bin"; $TPLDir = "$StartupDir/tpl"; $TmpDir = "$StartupDir/tmp/$$"; $TmpFile = "$TmpDir/Temp"; require "$BinDir/password.pl"; &ReadParse(); $ENV{PATH} = $ENV{PATH} . ":$BinDir"; umask 0000; mkdir($TmpDir,0777); chdir($TmpDir); #$SIG{'HUP'} = 'CleanUp'; #$SIG{'INT'} = 'CleanUp'; #$SIG{'QUIT'} = 'CleanUp'; #$SIG{'ABRT'} = 'CleanUp'; #$SIG{'KILL'} = 'CleanUp'; #$SIG{'BUS'} = 'CleanUp'; #$SIG{'SEGV'} = 'CleanUp'; #$SIG{'PIPE'} = 'CleanUp'; #$SIG{'ALRM'} = 'CleanUp'; #$SIG{'TERM'} = 'CleanUp'; #----------------------------------------------------------------- # Main Program #----------------------------------------------------------------- # `kill -9 xxx xxx`; # exit; #&PrintDebugCommands(); #exit; $path = $ENV{'PATH_INFO'}; &HTMLHeader(); print <<"end_tag"; $in{'db'} $in{'id'} end_tag $proc_id = $$; print "

Database: $in{'db'}

"; $pipename = "| $BinDir/ID2HTML.pl " . $in{'db'} . " $TPLDir/$in{'db'}.tpl " . ">$TmpFile.html 2>$TmpFile.err"; open (ID2HTML, $pipename); ### LOOP while ($in{'id'} ne "") { ($id_single, $rest) = split(/&/,$in{'id'}, 2); $in{'id'}=$rest; print ID2HTML "\$RID<$id_single>" . "|\n"; print ID2HTML "\$RID_INTERNAL<$id_single>" . "|\n"; print ID2HTML "\$RNO<$id_single>" . "|\n"; print ID2HTML "\$SRNO<$id_single>" . "|\n"; # print $id_single."
"; # print $rest."
"; # print $in{'id'}."
"; } ### END LOOP &flush (ID2HTML); close (ID2HTML); open (HTML, "<$TmpFile.html"); while () { print $_; } close (HTML); print <<"end_tag"; end_tag &CleanUp; exit; #----------------------------------------------------------------- # CleanUp #----------------------------------------------------------------- # Prints out the content type for a HTML document sub CleanUp { # unlink <$TmpDir/*>; # rmdir $TmpDir; exit; } sub ErrorExit { local( $ErrCode ) = @_; &CleanUp; exit( $ErrCode ); }