#!/usr/bin/perl

use CGI qw(:standard);
print header();

print "<html>";
print "<body bgcolor = \"eeccee\" text = \"black\">";
print "<center><h1><u>LIST OF ALL PARTICIPANTS";
print "</center></h1></u>";
print "<br><br><br>";

$i=1;

print "Code written in perl-cgi programming <p>";

dbmopen %guest,"data/dbguest",0666;

	@keys=keys %guest;
	$noOfKeys=$#keys+1;      # last index + 1

	print "NUMBER OF PARTICIPANTS = $noOfKeys <p>";
	
	print "<table border = 1 cellpadding = 2>";
	print "<tr>";
	print "<th>NAME OF PARTICANT (Parameter Name) <th> Values(Parameter Value(s))";

 	foreach ipfirstname(keys %guest) {

	 	$value = $guest{ipfirstname};
	 	@field = split(/&/,$value);
 	
 	 	print "<tr><td> ipfirstname <td>";
		print"<ul>";

 		foreach $field (@field) {
 			#print "Field --> $field";print "<br>";
    			($name, $value) = split(/=/, $field);
    			
    			print "<li>$name = $value";
    			#print "NAME VALUE PAIRS --> $name = $value. "; print"<BR>";
    		
    		}
    		print"</ul>";
	}
dbmclose %guest;

print "</table>";
print "</body>";
print "</html>";

	


