HTML form action ends up downloading perl file instead of executing it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been trying to run a simple perl-cgi script on windows 7. This is a simple HTML form with an OK button where clicking on OK button displays some text. But clicking the OK button on the HTML page, instead of executing and displaying perl file's output, the browser starts downloading the script. I have added handler in httpd.conf

AddHandler cgi-script .pl

But this doesn't help. I added the ExecCGI option in the httpd.conf but that didn't help either.

<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
    AllowOverride None
    Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

Here is the perl script being used:

#!C:\Perl\bin\perl
use CGI;

print "Content-type: text/plain","\n\n";
print "<html>","\n";
print "<head>\n\t<title>Server Information Ready</title>\n</head>","\n";
print "<body>","\n";
print "<h1>Server Information</h1>","\n";
print "</body></html>","\n";

And here is the html file:

<html>
<head><title>Server Information</title></head>
<body bgcolor="#EEAA55">
<h3>Please click OK to get the server information</h3>
<hr><pre>
<form action=""pun" style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">/localhost/cgi-bin/ctest/pranav1a.pl" method="post">
<input type="submit" value="OK">
</form>
</hr></pre>
</body>
</html>

I have tried this on chrome, IE and Mozilla. Mozilla and chrome start the perl file download, but IE just displays some weird content on clicking the OK button. How can I make the browser display output of file execution rather than starting the script download ?

PS: I have tried to use shebang line as '#!c:/Perl/bin/perl' which doesn't seem to work either. I am able to see the perl script's output when executed from cmd prompt.


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux