#!/usr/local/bin/perl -w


#both left or right ajustiment, when length is 0, will print the string
#put extra :: at the end of .def file to avoid 
# to print out last field as trash

if (@ARGV) {
 print "Content-Type: text/html \n\n";
 print "<p>$ARGV[0]\n";
}
else {
 print "Content-Type: text/html \n\n";
}
print "<HTML>\n";

print '<body bgcolor="#66FFFF">'; 
print '<font color="#660066">'; 

open(def_file,"/z/p/l/plee1274/jws/cgi-bin/oid.def") || print "die<p>";

@lines = <def_file>;
@colnames = split(":",$lines[0]);
close(def_file);


print "<FORM ACTION=\"http://grex.org:10000/cgi-bin/setoid.pl\">\n";

$i=0;
while (($colnames[${i}]) && ($colnames[${i}] ne "Date")) {
  if ($colnames[${i}] eq "oid") {
    print "Buyer email address<INPUT NAME=\"$colnames[${i}]\" VALUE=\"\"><p>\n";
  }
  else {
  print "$colnames[${i}] <INPUT NAME=\"$colnames[${i}]\" VALUE=\"\"><p>\n";
  }
  $i += 1;
}
print "<p><INPUT TYPE=\"submit\"> </FORM>";

print "</HTML>";


