Forum Moderators: phranque

Message Too Old, No Replies

failing to execute perl script

         

Anadon

5:01 pm on May 31, 2011 (gmt 0)

10+ Year Member



Hi,

I have a small problem running perl scripts under apache on a windows vista system.

I have the perl scripts sitting in the directory c:\wwwroot\cgi-bin

I have an html page that is executing a perl script with no problems using the following code.

<tr><FORM METHOD="POST" ACTION="cgi-bin/logon.pl">

The script then generates html code with further links similar to the following (checked with view source):

<a href=cgi-bin/help.pl>

When I hover over one of these links it shows the link as

"http://127.0.0.1/cgi-bin/cgi-bin/help.pl"

Which fails, when I click on it. If I manually edit the failed address in the address bar to remove the spurious cgi-bin, it works fine.

I think the problem is caused by an entry in the apache http.conf file.

ScriptAlias /cgi-bin/ "C:/wwwroot/cgi-bin/"

But I'm not sure.

Any suggestions on what I may be doing wrong?

phranque

1:37 am on Jun 1, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, Anadon!

you are referring to a relative url.
make that href value an absolute url or at least make it relative to the root directory by prepending the leading slash.

Anadon

7:56 am on Jun 1, 2011 (gmt 0)

10+ Year Member



Thank you so much for a quick reply, that resolved it.

Much appreciated.