Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old January 20th, 2005, 04:07 PM
LadyCherry LadyCherry is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 LadyCherry User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cgi Scripting problem

Help if anyone can point me in the right direction?
Im trying to run a cgi script and Im getting errors. The script seems to be right but errors out:

Code:
#!/usr/bin/perl -w

package path_ref;
require 5.002;
sub new {
    my $self = {};
        bless $self;
        return $self;
}
sub gopath {
        my ($self) = @_;
        my @ff;
        my $mainServer = $ENV{'SERVER_ADMIN'};
 $mainServer =~ s/root@/http:///o;
        my $server = "http://$ENV{'HTTP_HOST'}";
        my $ref = " / / / / / / ";
        if ($ENV{'HTTP_REFERER'}) {
                $ref = $ENV{'HTTP_REFERER'};
        }
        if      ($ENV{'SCRIPT_FILENAME'} =~ /printenv.cgi/) {  # do this for the INCLUDED shtml
                $ref = "$server$ENV{'DOCUMENT_URI'}";
        }
        @ff = split///, $ref;
        my $fil = pop(@ff);
        if (($ref =~ /$server/)||($ENV{'REQUEST_METHOD'} eq "PUT")){ # the form and cgi have same domain
                if ($mainServer eq $server) { # no new domain
                        @path = ($mainServer,"$ff[4]/$ff[5]", $server, $fil);
                } else { # new domain
                        @ff = split///, $ENV{'DOCUMENT_ROOT'};
                        @path = ($mainServer, "$ff[5]/$ff[6]", $server, $fil);
                }
        } else { # the form and cgi don't have same domain hacker
                @path = ("error");
        }
        return @path;
}
1;


The error I get is:
Code:
[root@site modP]# perl printenv.cgi
Use of uninitialized value in substitution (s///) at path_ref.pm line 14.
Use of uninitialized value in concatenation (.) or string at path_ref.pm line 15.
Use of uninitialized value in pattern match (m//) at path_ref.pm line 20.
Use of uninitialized value in string eq at path_ref.pm line 25.
Content-type: text/html


Any help at all will be appreciated.

-Lady Cherry

Reply With Quote
  #2  
Old March 15th, 2005, 04:07 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Cgi Scripting problem

i'm not sure of how to fix the problem but this site is mainly based for PHP and also the forum area you posted in is for questions based on how to setup, maintain and work with servers. not server scripts. i sugguest you go back to the forum and re-ask your question in the coding section. someone who knows CGI well may answer your question but otherwise like said before this site is mainly based off PHP

Reply With Quote
  #3  
Old April 29th, 2005, 05:46 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Cgi Scripting problem

I believe that when you run it from the command line it doesn't have HTTP_HOST defined (as that *should* come from the web browser or what not). Runnint it as a web page might help!
Good luck!

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > Cgi Scripting problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway