home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet 1996 World Exposition
/
park.org.s3.amazonaws.com.7z
/
park.org.s3.amazonaws.com
/
cgi-bin
/
Japan
/
Theme.0105
/
text.cgi
< prev
next >
Wrap
Text File
|
2017-09-21
|
3KB
|
124 lines
#!/usr/local/bin/perl
$| = 1;
# script for meeting room
# jrh
$CgiPath = '/stage/htdocs/cgi-bin/Japan/Theme';
push(@INC, "$CgiPath");
require 'jcode.pl'; # tends to be in /usr/local/lib/perl
require 'read-form.pl'; # tends to be in your cgi path
require 'frames.pl';
require 'meetinit.pl';
$ThisFile = '/stage/htdocs/cgi-bin/Japan/Theme/text.cgi';
# print "Content-type: text/html\n\n";
&read_in_data;
&init_dbm;
&process_data;
&print_frames;
&close_dbm;
#########################################################################
sub read_in_data {
# read in submitted form data contents into the hash %FormDataHash
&ReadInFormData(\%FormDataHash);
foreach $Key (keys(%FormDataHash)) {
$FieldValue = $FormDataHash{$Key};
&jcode::convert(*FieldValue, 'jis');
$FormDataHash{$Key} = $FieldValue;
# print "//$Key:$FormDataHash{$Key}//\n";
}
$UserName = $FormDataHash{'username'};
$ParkName = $FormDataHash{'park'};
}
sub init_dbm {
$TextPath = "$ThemePath/$ParkName/park/dbm/$TextLocation";
$ColorFilePath = "$ThemePath/$ParkName/park/dbm/$ColorFile";
$ColorNamesPath = "$ThemePath/$ParkName/park/dbm/$ColorNames";
dbmopen(%TextDB,$TextPath,0666);
dbmopen(%Colors,$ColorFilePath,0666);
dbmopen(%ColorName,$ColorNamesPath,0666);
}
sub process_data {
$Count = 0;
foreach $Key (sort(keys(%TextDB))) {
$TempArray[$Count] = $TextDB{$Key};
# print "$Key : $TextDB{$Key}\n";
$Count++;
}
$TextDB{"0"} = "<FONT COLOR=\"#$ColorName{$UserName}\">$UserName : $FormDataHash{'textin'}";
# print "0 : $TextDB{'0'}\n";
$Count = 1;
$Max = 10;
while ($Count ne $Max) {
$Displace = $Count - 1;
$TextDB{$Count} = $TempArray[$Displace];
# print "$Count : $TextDB{$Count}\n";
$Count++;
}
open (TEXT,">> $ThemePath/logs/$ParkName\.park\.log");
select (TEXT);
print "$UserName : $FormDataHash{'textin'}\n";
select (STDOUT);
close (TEXT);
}
sub print_frames {
select(STDOUT);
# tell the server that we're sending data back now
print "Content-type: text/html\n\n";
# now send the server some html stuff
print "<HTML>\n\n";
print "<HEAD>\n\n";
print "<TITLE>Meeting Place Entryway</TITLE>\n";
print "</HEAD>\n\n";
print "<BODY>\n\n";
print "<FORM ACTION=\"$ThemeCgi/text.cgi\" METHOD=\"POST\">\n\n";
print "<INPUT TYPE=\"TEXT\" NAME=\"textin\" SIZE=40>";
print "<INPUT TYPE=\"HIDDEN\" NAME=\"username\" VALUE=\"$UserName\">";
print "<INPUT TYPE=\"HIDDEN\" NAME=\"park\" VALUE=\"$ParkName\">";
print "</FORM>";
print "</BODY>\n\n";
print "</HTML>\n\n";
}
sub close_dbm {
dbmclose(%TextDB);
dbmclose(%Colors);
dbmclose(%ColorName);
}