#!/usr/bin/perl -w
use CGI;
$query = new CGI;
$call_PID=$$;
sub htmldie {
local ($mesg,$title)=@_;
$title || ($title = "CGI error!");
print <<"HTML_DIE_END";
Content-type: text/html
$title
$title
$mesg
HTML_DIE_END
exit;
}
#exit;
#while (open(CEMENT,"<~eric/public_html/cgi-bin/cement.txt")){};
#print `pwd`;
open(CEMENT,">/raid0/home/dusting/public_html/cgi-bin/cement.txt.$call_PID") || &htmldie("can't cement.txt.$call_PID");
for ($i = 0; $i < $query->param('total'); $i++){
$tempfile = $query->param("n$i");
$tempr = $query->param("r$i");
$tempg = $query->param("g$i");
$tempb = $query->param("b$i");
if($tempr ne "" || $tempg ne "" || $tempb ne ""){
print CEMENT "$tempfile ",$tempr*1," ",$tempg*1," ",$tempb*1,"\n";
}
}
close(CEMENT);
#system("/raid0/home/eric/public_html/cgi-bin/trowel.pl >/dev/null 2>&1");
# and htmldie `/raid0/home/eric/public_html/cgi-bin/trowel.pl 2>&1`;
#print<<"EOF";
#Content-type: text/html\n\n
#
#
#EOF
#print $retval, "\n";
#print "\n";
#system("cp /raid0/home/eric/cement/cement.txt.jpg /raid0/home/eric/public_html/cement/");
print "Content-type: text/html\n\n";
print<<"EOF";
EOF
print<<"EOF";
The image you generated is
You also managed to make a cement.txt as follows:
EOF
print `cat /raid0/home/dusting/public_html/cgi-bin/cement.txt.$call_PID`;
print <<"EOF";
Go back to Dusting Form
EOF
#:system("rm -f /raid0/home/eric/cement/cement.txt.$call_PID");