Everyone, how are you there?
I want to send a value from a PHP page by Form Action to a CGI script written in Perl. The method is either POST or GET, it doesn’t matter. I want to do it as simplest as possible. Is there any way without using CGI module? Or one must use CGI module?
Here is my trial without using CGI module. Please give me comments or feedback to help me around. Thanks, thanks, everyone.
<?php
$musician_fn = $_POST[‘musician_fn’];
echo <<<END
<form action=“URL_PATH/cgi_01.pl method=“POST”>
<select name=“musician_fn”>
<option value=“name1”> Name1 </option>
<option value=“name2”> Name2 </option>
…
</select>
<input type=“submit” Value=“Go”>
</form>
END;
?>
Now, CGI in Perl.
#! /use/bin/perl -w
$musician_fn = $FORM{musician_fn};
print “$musician_fn”;
Unfortunately, this way doesn’t work.
Another CGI by using CGI module, which I used to use.
#! /use/bin/Perl -w
Use CGI qw(:standard);
$musician_fn = param(“musician_fn”);
print “$musian_fn”;
This code worked before in Perl 5.8.8, but not in Perl 5.36.0. How should I fix? Thanks,thanks,everyone.
Any idea to fix the bug.
2
Answers
I got it by the way of using CGI module in Perl. CGI module was loaded by my administrator by cpan according to him.
HERE is PHP part
======================================
And here is the Perl part.
This way did the good capture of a variable from PHP to Perl_CGI.
======================================
Here is on my way to turtle code, at fist PHP code, named turtle_cgi.php
================= And here is turcle_cgi.pl (on my way to turtle codes)
It worked by calling from WEB-caster.
There seem to be syntax errors in both your php and perl.
Note the quotes are plain quotes.
many will say not to use CGI but going with what you asked:
These two files can talk to each other:
Note I call this file getPhp.pl