Page 1 of 1

Passing data from php

Posted: Mon Aug 20, 2007 3:32 am
by sandy1028
Hi,

The form data sould be sent from php page to perl file.
<form action="test.pl">
But it is not working.
Should I change the path in form action to /cgi-bin/test.pl and copy the test.pl file to /var/www/cgi-bin

Please help me with this

Re: Passing data from php

Posted: Mon Aug 20, 2007 7:36 am
by sandy1028
sandy1028 wrote:Hi,

The form data sould be sent from php page to perl file.
<form action="test.pl">
But it is not working.
Should I change the path in form action to /cgi-bin/test.pl and copy the test.pl file to /var/www/cgi-bin

Please help me with this

please help me with this.. I am not able to find the problem or should I change the server configuration

Re: Passing data from php

Posted: Mon Aug 20, 2007 7:38 am
by VladSun
sandy1028 wrote:>But it is not working.
More details, please ...
sandy1028 wrote:>Should I change the path in form action to /cgi-bin/test.pl and copy the test.pl file to /var/www/cgi-bin
Definitely. Also, you have to chmod it to 0755.

Re: Passing data from php

Posted: Tue Aug 21, 2007 12:53 am
by sandy1028
VladSun wrote:
sandy1028 wrote:>But it is not working.
More details, please ...
sandy1028 wrote:>Should I change the path in form action to /cgi-bin/test.pl and copy the test.pl file to /var/www/cgi-bin
Definitely. Also, you have to chmod it to 0755.

How to use the perl file without cgi-bin directory.
Is it possible to use it.

The php and perl files are in same directory and is it necessary to copy the perl file to cgi-bin directory

Posted: Tue Aug 21, 2007 1:44 am
by RhapX
<form action="test.pl" method="post">

Try that.

Re: Passing data from php

Posted: Tue Aug 21, 2007 7:09 am
by VladSun
sandy1028 wrote: How to use the perl file without cgi-bin directory.
Is it possible to use it.

The php and perl files are in same directory and is it necessary to copy the perl file to cgi-bin directory
I don't think so.
You need to declare a directory to be a ScriptAlias in Apache's httpd.conf. Then you put your executables (*.pl) in this directory. If you put nonexecutable file in there (i.e. file.txt, 0644) and HTTP request it, you will get "Forbidden" error.