Passing data from php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sandy1028
Forum Commoner
Posts: 60
Joined: Thu Jul 26, 2007 3:56 am

Passing data from php

Post 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
sandy1028
Forum Commoner
Posts: 60
Joined: Thu Jul 26, 2007 3:56 am

Re: Passing data from php

Post 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
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Passing data from php

Post 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.
There are 10 types of people in this world, those who understand binary and those who don't
sandy1028
Forum Commoner
Posts: 60
Joined: Thu Jul 26, 2007 3:56 am

Re: Passing data from php

Post 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
RhapX
Forum Commoner
Posts: 30
Joined: Mon Dec 05, 2005 5:24 pm
Location: Seattle, Washington

Post by RhapX »

<form action="test.pl" method="post">

Try that.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Passing data from php

Post 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.
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply