home *** CD-ROM | disk | FTP | other *** search
- import java.util.*;
- import Cgi;
-
- public class Mult extends Object
- {
-
- public static void main(String argv[])
- {
- /* Variables for the data. */
-
- Hashtable dataDict;
- Enumeration iter;
- String key,value;
- Vector avalue;
-
- /*
- * Print the header required for all CGI scripts
- * that output dynamic text data.
- */
- System.out.print("Content-type: text/plain\n\n");
-
- System.out.println("The form data is:\n");
-
- dataDict = Cgi.readParse();
-
- iter = dataDict.keys();
-
- while(iter.hasMoreElements())
- {
- key = (String) iter.nextElement();
-
- /* See if this is an array, if not, print it */
-
- if(key.startsWith("A_"))
- {
- int i,max;
-
- avalue = (Vector) dataDict.get(key);
-
- max = avalue.size();
-
- System.out.println("Found a key with multiple values:");
-
- key = key.substring(2,key.length());
-
- for(i=0;i<max;i++)
- {
- System.out.println(key + "=" + avalue.elementAt(i));
- }
- }
- else
- {
- System.out.println(key + "=" + dataDict.get(key));
- }
- }
- }
- }
-