#!/usr/bin/perl ############################################################################### # JtoP.cgi # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # # # Last modified: 06/27/10 # ############################################################################### # Set-up the cgi enviroment # this little gizmo is something I adopted # and works like a champ use CGI; $query = new CGI; @names = $query->param; foreach $parameter (@names) { $_ = $query->param($parameter); $input{$parameter} = $_; } # we won't have this until the Ajax kicks in after page load # then it happens quietly behind the scenes if ($_) { $screenwidth = $input{'screenwidth'}; $screenheight = $input{'screenheight'}; $availwidth = $input{'availwidth'}; $availheight = $input{'availheight'}; $screen = "$input{'screenwidth'} x $input{'screenheight'}"; $availscreen = "$input{'availwidth'} x $input{'availheight'}"; $colordepth = $input{'colordepth'}; open(FILE, ">>foobat.txt"); print FILE "$screen\n"; print FILE "$availscreen\n"; print FILE "$colordepth\n"; close FILE; } # no HTML here just get to the Ajax and send the data print "content-type: text/html\n\n"; print qq~ ~; 1;