Skip to content

Instantly share code, notes, and snippets.

@koduki
Last active July 10, 2016 02:23
Show Gist options
  • Save koduki/c316060c658b06c66c7c3b03b5af70d7 to your computer and use it in GitHub Desktop.
Save koduki/c316060c658b06c66c7c3b03b5af70d7 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/perl
print "Content-type: text/html\n";
print "\n";
print "<html>\n";
print "<head>\n";
print "<title>Hello World</title>\n";
print "</head>\n";
print "<body>\n";
print "Hello World.\n";
print "</body>\n";
print "</html>\n";
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo 'Hello World'; ?>
</body>
</html>
#!/bin/bash
# リクエストパラメータは環境変数から取得
NAME=`echo ${QUERY_STRING}|sed 's/=/ /g'|awk '{print $2}'`
# content-typeを指定
echo "Content-type:text/plain"
# headerとbodyの区切りに空行
echo # body部
echo "Hello World, "${NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment