I was trying to invoke a CGI program via an html file. But got stuck for the error "file not found".
I am trying the same program as in the following site:
Please find below the html file:
<html> <head> <title>The Employee Database</title> Appears on title bar </head> <body> <h1> Employee Form </h1> Appears in a large bold font <hr> Adds a horizontal rule <form action=”http://localhost/~ravbholua/emp_add.pl” method=get> Emp-id: <input type=”text” name=”empid” size=4> <br> Name: <input type=”text” name=”ename” size=30> <br> Designation: <input type=”text” name=”desig” size=15> <br> Department: <input type=”text” name=”dept” size=15> <br> Dateoffuse: <input type=”text” name=”dtbirth” size=10> <br> noSalary: <input type=”text” name=”salary” size=10> <br> <br> <center> <input type=submit value=”Add”> The Add button is centered </center> </form> </body> </html>
To work in my system, I changed (changed than what is mentioned
in the link above) the path of the CGI program
file. The path is now:
When I click on Add button, I get error that 'file not found'. Please see attachment.
Please have a look at the form (attachment).
Why it is not finding the file which is in the home directory of username "ravbholua"? These 2 attachments w'd help you to catch the issue.
I have the same query in the below link but isn't resolved yet. Please look through it. http://www.linuxquestions.org/questions/linux-server-73/web-page-not-able-to-find-cgi-program-file-4175476182/
localhost/~ravbholua/are you trying to access your
$HOME? That won't work, you should have the perl script in the same directory tree as you place the HTML file.