這是一件令人沮喪的事情。使用POST將變量從PHP傳遞到Perl
如果我運行這個perl腳本...
#!/usr/bin/perl
use CGI qw/:standard/; # load standard CGI routines
my $query = new CGI;
my $club5 = $query->param('club5');
my $messagetext = $query->param('messagetext');
print header, # create HTTP header
start_html('Hello World'), # start of HTML
h1('Hello World'), # level 1 headers
h1($club5),
h1($messagetext),
end_html; # end of HTML
1;
從遠程Chrome瀏覽器與
http://www.<hostname>/cgi-bin/message_test.pl?club5=coop9&messagetext=test
正確的頁面產生。但是,如果我再從同一個瀏覽器與
http://<hostname>/message_test.php
沒有執行這個PHP程序...
<?php
$user_id = "10006";
echo <<<END
<html>
<head>
<title>Send Message</title>
</head>
<BODY bgcolor="#e8e8e8">
<br>
<table width="450px" height="150px" align="center" valign="top" bgcolor="#e8e8e8">
<form action="http://<hostname>/cgi-bin/message_test.pl" method="post">
<INPUT TYPE="hidden" NAME="user_id" VALUE="$user_id">
<tr align="center" valign="top">
<td>
<br>
<font face="Verdana" size="2">
<input name="messagetext" type="text" size="64">
<br>
<br>
<br><center>
<input name="submit" type="submit" value="SEND">
</font>
</td>
</tr>
</form>
</table>
</body>
</html>
END;
?>
返回。我發誓我在一年前有類似的事情發生。使用HTTP POST將(隱藏)變量傳遞給Perl時,是否有新的東西需要注意?
在我看得更遠之前:'
不錯,但爲了清晰起見,我添加了該目錄(!?)我編輯了這篇文章。 – softex
你期待看到什麼?我沒有收到REQUEST-RESPONCE命令。 – fperet