#!/usr/bin/perl
# Copyright (C) 2005 Jason Woofenden # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This file 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. # # You should have received a copy of the GNU General Public License # along with This file; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA.
use strict; use warnings;
use vars qw(%info %html); #this is how you define globals for this file (so it works under Registry) use vars qw($red %block_handlers %inline_handlers $image_url $FD $edit);
$red = 0;
sub import_post { my $i; my $key; my $val; my $buf; my @in;
%info = ();
if($ENV{'CONTENT_LENGTH'}) { $buf = ""; read(STDIN,$buf,$ENV{'CONTENT_LENGTH'}) || print "SOERUCHSERCUHSOERCUHSRECUH";
@in = split(/&/,$buf); #takes variable $in and cuts it into pieces seperated by (/&/ i guess) and puts the pieces into LIST @in
foreach $i (0 .. $#in) # loop through index numbers for @in list { # Convert plus's to spaces $in[$i] =~ tr/+/ /;
# Split into key and value. ($key, $val) = split(/=/,$in[$i],2); # splits on the first =.
# Convert %XX from hex numbers to alphanumeric $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge;
$info{$key} = $val; #put values into associative array } } else { foreach $a (keys(%info)) { delete $info{$a}; } } }
sub redirect { my $addr = shift; print("Status: 302 Moved Temporarily\r\n"); print("Location: $addr\r\n\r\n"); print <EOF <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head>