#!/usr/bin/perl print "Content-type: text/html\n\n"; print "RESP=OK"; my ($category, $item) = &read_item_file($form{'category'},$form{'item'}); print "
Buy
Now";
use vars qw(%config %category %form);
use strict;
local %config;
$config{'basepath'} = '/home/httpd/vhosts/efret.com/httpdocs/apps/auction/';
$config{'closedir'} = 'closed';
$config{'regdir'} = 'reg';
%category = (
computer => 'Computer Hardware and Software',
elec => 'Consumer Electronics',
other => 'Other Junk',
);
$config{'adminpass'} = 'auction';
$config{'scripturl'} = 'www.efret.com';
config{'colortablehead'} = '#BBBBBB';
$config{'colortablebody'} = '#EEEEEE';
$config{'sitename'} = 'Your Site Name Here';
$config{'aftermin'} = 5;
$config{'flock'} = 1;
$config{'newokay'} = 1;
local %form = &get_form_data;
if ($form{'action'} eq 'hello') { &hello; }
elsif ($form{'action'} eq 'whatever1') { &whatever1; }
elsif ($form{'action'} eq 'whatever2') { &whatever2; }
else { &hello; }
print $config{'footer'};
#-#############################################
sub hello {
print qq|
My Test Script
|;
}
#-#############################################
sub whatever1 {
print qq|
Put a sub here
|;
}
#-#############################################
sub whatever2 {
print qq|
Put a sub here
|;
}
#-#############################################
# Sub: Read Reg File (alias)
sub read_reg_file {
my $alias = shift;
return '' unless $alias;
# verify the user exists
&oops('Your alias may not contain any non-word characters.') if $alias =~ /\W/;
$alias = ucfirst(lc($alias));
return '' unless -r "$config{'basepath'}$config{'regdir'}/$alias.dat" and -T "$config{'basepath'}$config{'regdir'}/$alias.dat";
open FILE, "$config{'basepath'}$config{'regdir'}/$alias.dat";
my ($password,$email,$add1,$add2,$add3,@past_bids) = Please hit the back browser on your browser to try again or contact the auction administrator if you belive this to be a server problem.
Error:
$_[0]
\n";
print $config{'footer'};
die "Error: $_[0]\n";
}
#-#############################################
# Sub: parse bid
sub parsebid {
$_[0] =~ s/\,//g;
my @bidamt = split(/\./, $_[0]);
$bidamt[0] = "0" if (!($bidamt[0]));
$bidamt[0] = int($bidamt[0]);
$bidamt[1] = substr($bidamt[1], 0, 2);
$bidamt[1] = "00" if (length($bidamt[1]) == 0);
$bidamt[1] = "$bidamt[1]0" if (length($bidamt[1]) == 1);
return "$bidamt[0].$bidamt[1]";
}
#-#############################################
# Sub: Get Form Data
sub get_form_data {
my $temp;
my $buffer;
my @data;
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
foreach $temp (split(/&|=/,$buffer)) {
$temp =~ tr/+/ /;
$temp =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
$temp =~ s/[\r\n]/ /g;
push @data, $temp;
}
foreach $temp (split(/&|=/,$ENV{'QUERY_STRING'})) {
$temp =~ tr/+/ /;
$temp =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
$temp =~ s/[\r\n]/ /g;
push @data, $temp;
}
return @data;
}
#-#############################################