Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
ashkon
Client


Joined: Jan 15, 2006
Posts: 22

PostPosted: Sun Feb 12, 2006 12:34 am Reply with quote

Hi,

In one of my modules I have a dropdown form that loads a list of people in an iframe somwhere else on the page. It looks like this:

Code:
      <form method="post"

 onsubmit="return dropdown(this.gourl)" target="targetnames"
 action="/cgi-bin/redirect.pl">
        <select name="gourl">
        <option value="">Select Category...</option>
        <option value="/[path to option]">[name]</option>
        <option value="/">[name]</option>
        <option value="">[name]</option>
        </select>
        <input value="Go" type="submit"> </form>


But when I try to use the menu, I get the following error: "The server encountered an internal error or misconfiguration and was unable to complete your request."

The error log gives two relevant reports:

"error: file has no execute permission: (/[path]/cgi-bin/redirect.pl)"

and

"Premature end of script headers: /[path]/cgi-bin/redirect.pl

I don't know anything about running PERL scripts. I just checked the PERL installation path in Cpanel and dumped the file into cgi-bin in hopes that it would work. The script itself is something I copy and pasted from an internet tutorial. Here is the script:



Code:
#!/usr/bin/perl

# NOTE: Modify the first line to point to the local Perl program.
#
# redirect.pl
#
read(STDIN, $query_string, $ENV{'CONTENT_LENGTH'});
# Parse name-value pairs and de-webbify.
@key_value_pairs = split(/&/, $query_string);
foreach $key_value (@key_value_pairs) {
 ($key, $value) = split (/=/, $key_value);
 $key =~ tr/+/ /;
 $value =~ tr/+/ /;
 $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg;
 if (defined($array{$key})) {
 $array{$key} = join("|", $array{$key}, $value);
 } else {
 $array{$key} = $value;
 }
}
if ($array{'url'} eq "") {
 print "Status: 204 Do Nothing\n\n";
 exit(0);
}
elsif ($array{'url'} !~ /^http/) {
 $prefix = "http://" . $ENV{'SERVER_NAME'};
 if ($ENV{'SERVER_PORT'} ne "80") {
 $prefix .= ":" . $ENV{'SERVER_PORT'};
 }
 if ($array{'url'} !~ /^\//) {
 $prefix .= "/";
 }
 $array{'url'} = $prefix . $array{'url'};
}
print <<EOF;
Content-type: text/html
Location: $array{'url'}

EOF


If anyone could let me know why it doesn't work, or if there is a better way to use a dropdown menu, I would really appreciate it.
 
View user's profile Send private message
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Sun Feb 12, 2006 10:34 pm Reply with quote

"error: file has no execute permission: (/[path]/cgi-bin/redirect.pl)"

Indicates that you need to CHMOD the file - 755 or 777 if needed

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©