#!/usr/bin/perl
#################
# Form Data Parsing
$fields{'directstart'} = "true";
$fields{'appbg'} = "89,0,179";
$fields{'chatroomident'} = "jchatter";
$fields{'appfg'} = "0,255,0";
$fields{'chan'} = "ChattersOnline";
$fields{'bgcolor'} = "#5900B3";
$fields{'pagecolor'} = "#cccccc";
$fields{'titlecolor'} = "#00ff00";
$fields{'bordercolor'} = "#000000";
$fields{'fonttype'} = "Arial";
$fields{'titlesize'} = "30";
$fields{'homepageurl'} = "http://www.chattersonline.com";
$fields{'textcolor'} = "0,0,0";
$fields{'textareabg'} = "255,255,255";
$fields{'servcmdcolor'} = "255,102,0";
$fields{'serverrorcolor'} = "255,0,0";
$fields{'usercmdcolor'} = "0,0,255";
$fields{'actioncolor'} = "0,153,153";
$fields{'nick'} = "Guest";
$fields{'chatfontsize'} = "12";
if ($ENV{'REQUEST_METHOD'} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; }
else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); }
@pairs = split(/&/, $buffer);
$querystring = "";
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$querystring = $querystring . $name . "=" . $value . "&";
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$fields{$name} = $value;
}
if ($fields{'chan'} eq 'tempSeanBiggerstaff') {
$silentparams = "
";
}
if ($fields{'webs'} eq '') {
$fields{'webs'} = "Welcome to $fields{'chan'} Java Chat!";
}
$referer=$ENV{'HTTP_REFERER'};
use CGI;
my $q=CGI->new();
$room = $fields{'chan'};
$referer=$q->escape($referer);
$querystring=$q->escape($querystring);
$room=$q->escape($room);
$encodedvars = "room=$room&referer=$referer&querystring=$querystring";
if ($ENV{'HTTP_USER_AGENT'} =~ /WebTV/)
{
############################################################################
######################### START OF WEB TV CHAT ############################
############################################################################
$webtventrance = "http://www.chattersonline.com/ads/webtv/wtvchat.php?serv=206.41.117.133&port=7070&chan=$fields{'chan'}";
print "Location: $webtventrance\n\n";
}
else
{
############################################################################
########################## START OF JAVA CHAT #############################
############################################################################
print "Content-type: text/html\n\n";
print <
$fields{webs}