Created
February 9, 2017 14:14
-
-
Save leo-mon/314113b1ace11b93a1b992635fa6f68d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cgi | |
form = cgi.FieldStorage() # フォームからの値の取得 | |
name = form.getvalue('name', '') | |
message = 'ようこそ、' + name + 'さん!' | |
print('Content-type: text/html; charset=UTF-8') # ヘッダ開始 | |
print() # ヘッダ終了、これを省くとヘッダと認識してもらえない。 | |
print('<html>') | |
print('<head>') | |
print('<title>テスト</title>') | |
print('</head>') | |
print('<body>') | |
print(message) | |
print('</body>') | |
print('</html>') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment