CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I Need a Programmer for Freelance Work:
Reply to: Re: Need Someone to Look Under the Hood
 
Subject:
Guest Username:
E-mail address:
Post Style:      Get Markup Help
Icon:
none









Post:




Replying to: Re: Need Someone to Look Under the Hood by Revival Fire
Post: Dennis,

I fixed that but it still does not work. I have one other cgi that I know works in my cgi-bin so I know that it must be functional. That script is at [url=http://www.phonechristian.com/cgi-bin/PhoneCSV/readcsvplus.pl]PhoneChristian Rates

Someone gave me another script that was supposed to work, look in Beginners forum, but it just will not! I even chmoded to 777. The only thing I can think is to try to redo the cgi script he gave me on my computer and redo the upload by ASCII just to make sure I did it right.

Here is the error message I get with the jumpbox cgi...

[Wed Nov 7 10:41:43 2001] [error] [client 204.246.7.225] Premature end of script headers: /home/pc/phonechristian-www/cgi-bin/jumpbox/jumpbox.pl

Here is the script...


# JumpBox Version 2.0
# Copyright 2001 by Matt Riffle All Rights Reserved.
# Initial Release: 2/20/99 This Release: 5/26/01
# pingPackets http://www.pingpackets.com/

# This program 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
# of the License, or (at your option) any later version.

# 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. It is included in
# this distribution in the file "license.txt".

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.

## Edit the variables below accordingly. See the included readme.txt file
## for more information.

use strict;

# This is the list of referrers which are allowed to access this script.
# If you don't care who uses it, set it to (). Note that you don't need the
# "www" prefix for a domain name: each name in the script is check # with and
# without it. Also note that more and more, browsers are not sending referrer
# info, for privacy. This is really a minimal protection.

my @valid_ref = ('phonechristian.com');

# $default should be set to the URL the script will redirect to in the
# case it is unable to determine where it's supposed to send the user

my $default = 'http://www.phonechristian.com/';

# If $method is set to 0, the form input should be a URL to redirect to.
# Otherwise, it should be a "key" to a URL (see %keys below). More info
# on this can be found in the readme.txt file.

my $method = 0;

# $if $method is set to 1, then the following array should be used to
# associate keywords with the URL they are to represent.

my %keys = (
'perl' => 'http://www.pingpackets.com/perl-portal/',
'bbs' => 'https://www.pingpackets.com/webapps/bbs/'
);

# Note: there's no comma after the last URL before the closing parenthesis

###### Do Not Edit Below This Line ######

&secure || &error(0);
my $goto = &decode || &error(1);

$goto = $keys{$goto} if $method;
&good_url($goto) || ($goto = $default || &error(1));

print "Location: $goto\n\n";
exit;

sub secure {
unless (@valid_ref && $ENV{'HTTP_REFERER'}) { return 1 }
for (@valid_ref) {
return 1 if ($ENV{'HTTP_REFERER'} =~ m#^https?://(www\.)?$_/#)
}
return 0;
}

sub good_url {
return (shift =~ m#^https?://[\w\.\-]+/#i);
}

sub error {
my @errors = (
'has been called from a domain that is not authorized to use it',
'was unable to determine what URL to redirect you to'
);
print "Content-type: text/html\n\nSorry, the script ",$errors[shift],'.<p>';
exit;
}

sub decode {
for (split /&/, <STDIN>) {
next unless /^goto=/;
my ($v) = (split /=/)[1];
$v =~ tr/+/ /; $v =~ s/%([a-f\d]{2})/pack('C',hex($1))/egi;
return $v;
}
}


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives