#topicpath //////////////////////////////////////////////////////////////////////////////// * SSI からの呼び出し(さくら) [#se3ae5af] ** 引数付きの場合は、 include virtual を使う [#m32cef2c] - *.shtml から - *.shtml から hoge.cgi に引数 arg1 を渡して実行したい場合 <!--#include virtual="./hoge.cgi?arg1" --> - このように、*.shtml の中に出力が埋め込まれる場合であっても、CGIは Content-Type ヘッダの出力が必要になる。 print "Content-Type: text/plain; charset=utf-8" . "\n\n\n"; # これを最初に出さないと出力されない //////////////////////////////////////////////////////////////////////////////// * CGI でステータスコードを返す方法 [#c29d5a6f] - 参考:[[Perlでステータスコードを返すとき>http://www.yanbe.net/blog/archives/000371.html]] - 例: #!/usr/bin/perl # 引数で渡した値がHTTP_STATUSとなる。 use English; my ($HTTP_STATUS) = 200; foreach $argv (@ARGV) { $HTTP_STATUS = $argv; } &return_status_code ($HTTP_STATUS); exit 0; #################################################################### sub return_status_code { my ($http_status) = $_[0]; print "Content-type: text/html\n"; print "Status: $http_status\n"; print "HTML"; }