Home: Need a Custom or Prewritten Perl Program?: I Need a Programmer for Freelance Work:
Need Someone to Look Under the Hood

Revival Fire

Nov 6, 2001, 4:11 AM

Views: 13087
Need Someone to Look Under the Hood

I know this may look really dumb, but I have been trying to install a cgi script for a drop down menu and it does not work for some reason. I think the cgi works but the dropdown html is not calling it. I am pretty frustrated with it but I really need it to work. If someone could take a lok under the hood for me so to speak and see what is wrong I would appreciate it. Here is the url of the dropdown box's action script...


It seems to work with the url address typed into the address bar alone but when I call it with this test dropbox html page...


It does not work for some reason. I am using the html given by http://www.pingpackets.com/

I also uploaded the html and the cgi by ASCII
I have installed cgi plenty of times and never this kind of a problem.



Nov 7, 2001, 6:03 AM

Views: 13077
Re: Need Someone to Look Under the Hood

Okay, I can't view the cgi script, but what I can see is the HTML. You have, on that page, three forms with the same action, three submit buttons with the same name, and three drop down boxes with the same name. How does the script determine which form is being submitted, which dropdown was selected and which submit button was pressed? I always thought this could confuse a cgi process.

Waiting for your reply,


$a="c323745335d3221214b364d545a362532582521254c3640504c37292f493759214b3635554c3040606a0",print unpack"u*",pack "h*",$a,"\n\n"

Revival Fire

Nov 7, 2001, 7:03 AM

Views: 13076
Re: Need Someone to Look Under the Hood


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] 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
# 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";

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>';

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;

(This post was edited by Jasmine on Feb 10, 2002, 2:58 PM)


Feb 10, 2002, 3:51 AM

Views: 13026
Re: [Revival Fire] Need Someone to Look Under the Hood

Someone gave me another script that was supposed to work, look in Beginners forum, but it just will not! I even chmoded to 777.

CGI scripts are supposed to be chmodded to 755 not 777.


Feb 26, 2002, 2:22 AM

Views: 12993
Re: [Anonymous] Need Someone to Look Under the Hood

Yep. at f2s.com they did not even execute CGI scripts when they had too much freedom. For example, chmodding a directory 777 caused everything to result in 500 IS errors.

Yet Another Perl Programmer

~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool