http://www.perlmonks.org?node_id=633743


in reply to Display the data passed from php

Usually CGI scripts are placed in cgi-bin directory (with 755 access rights).

So your form must look like

<form method="get" action="/cgi-bin/mail_contact.pl" onsubmit="return +validate()">

Also don't forget to add

#!/usr/bin/perl -w
in the first line of your script (to tell server where the perl is)

Replies are listed 'Best First'.
Re^2: Display the data passed from php
by sandy1028 (Sexton) on Aug 20, 2007 at 09:11 UTC
    When I added the /cgi-bin/mail_contact.pl in form Got the output as
    The requested URL /cgi-bin/mail_contact.pl was not found on this serve +r. ---------------------------------------------------------------------- +---------- Apache/2.0.52 (Red Hat) Server at xxx.xxx.xx.x Port 80
      Do you have mail_contact.pl in your /cgi-bin directory?
        File is in /var/www/html/abc/mail_contact.pl and all php files are also in this directory. The form action to mail_contact.pl displays the contents of the file not just the output