I have a guestbook.htm file in the directory named as Chrome (/home/chankey/Desktop/Chrome/guestbook.htm) whose content is given below
<html>
<head>
<title>Guestbook</title>
</head>
<body>
<form action="/home/chankey/Desktop/Chrome/guestbook.pl" method="get">
<table>
<tr><td>Name</td><td><input name="name" type="text" value=""></td></tr>
<tr><td>E-Mail</td><td><input name="email" type="text" value=""></td></tr>
<tr><td>Location</td><td><input name="loc" type="text" value=""></td></tr>
<tr><td>Comments</td><td>
<TEXTAREA name="comments" rows="10" cols="32"></TEXTAREA></td></tr>
</table><br><br>
<input type="submit" value="Add Entry">
</form>
</body>
</html>
In the same Chrome directory I have one file "guestbook.pl" whose content is
#!/usr/bin/perl
my $query_string = "";
#Get the input
if ($ENV{REQUEST_METHOD} eq 'POST') {
read(STDIN, $query_string, $ENV{CONTENT_LENGTH});
} else {
$query_string = $ENV{QUERY_STRING};
}
##### We will remove this
print "Content-Type: text/html\n\n";
print "Query String is \n<br> $query_string";
##### We will remove this
When I am executing the guestbook.htm file there appears a form, when I fill the data and click on "Add Entry" button a new page opens where the complete script appears.
i.e. the script "guestbook.pl" is not executing. May I know the reason behind this? Why the script is not executing? (I have already given executing permission to this file).
In the httpd.conf file I have added
AddHandler cgi-script cgi pl
<Directory /home/chankey/Desktop/Chrome/>
Options +ExecCGI
</Directory>
Still it is not executing. Let me know the reason.
file://URL)?