diff --git a/judges/azenv.php b/judges/azenv.php index fe565a2..17e8a37 100644 --- a/judges/azenv.php +++ b/judges/azenv.php @@ -1,32 +1,48 @@ - + $value ){ + if (strpos($header , 'REMOTE')!== false || strpos($header , 'HTTP')!== false || strpos($header , 'REQUEST') !== false) { + $arr[$header] = $value; + } + } + $json = json_encode($arr); + + echo $json; + exit; +} else { +?> + -AZ Environment variables 1.04 +AZ Environment variables 1.05
  $value )
-{ if 	(strpos($header , 'REMOTE')!== false || strpos($header , 'HTTP')!== false ||
-	strpos($header , 'REQUEST')!== false) {echo $header.' = '.$value."\n"; } }
+foreach ($_SERVER as $header => $value ) {
+    if (strpos($header , 'REMOTE')!== false || strpos($header , 'HTTP')!== false || strpos($header , 'REQUEST')!== false) {
+        echo $header.' = '.$value."\n";
+    }
+}
+}
 ?>
 
- \ No newline at end of file + diff --git a/judges/azenv.pl b/judges/azenv.pl index c8372c4..4e50c88 100644 --- a/judges/azenv.pl +++ b/judges/azenv.pl @@ -1,16 +1,15 @@ -#!C:/perl/bin/perl -#!/usr/local/bin/perl +#!/usr/bin/perl # # Use the correct shebang according to OS. # You can rename this script to azenv.cgi if .pl # extension is not supported. # ########################################################################## -# -# AZ Environment variables 1.04 © 2004 AZ +# +# AZ Environment variables 1.05 © 2024 AZ # Civil Liberties Advocacy Network # http://clan.cyaccess.com http://clanforum.cyaccess.com -# +# # AZenv is written in PHP & Perl. It is coded to be simple, # fast and have negligible load on the server. # AZenv is primarily aimed for programs using external scripts to @@ -21,25 +20,46 @@ # ########################################################################## -print < -AZ Environment variables 1.04 +AZ Environment variables 1.05
 EOC
-	
-foreach $var (keys(%ENV))
-{ if ($var =~ /REMOTE/ || $var =~ /HTTP/ || $var =~ /REQUEST/)
-  { print $var.' = '.$ENV{$var}."\n"; } }
-  
-print <