Created
October 16, 2023 08:48
-
-
Save uxiun/f82771f08a8a09672e26f5fc27985312 to your computer and use it in GitHub Desktop.
wwws/cgi-bin/wp/
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
#!/usr/bin/ruby | |
# encoding: utf-8 | |
require "cgi" | |
cgi = CGI.new | |
print cgi.header("text/html; charset=utf-8") | |
messages = "messages..." | |
# f = open("bbsdata.txt", "r:UTF-8") | |
# messages = CGI.escapeHTML(f.read) | |
# f.close | |
print "Hello, World" | |
# print <<EOF | |
# <html> | |
# <head> | |
# <meta charset="utf-8"> | |
# </head> | |
# <body> | |
# <div> | |
# <form | |
# action="https://cgi.u.tsukuba.ac.jp/~s2211482/wp/update.rb" | |
# method="get" | |
# > | |
# <label> | |
# 名前 | |
# <input type="text" name="name"> | |
# </label> | |
# <label> | |
# 内容 | |
# <input type="text" name="message"> | |
# </label> | |
# <div> | |
# <input type="submit" value="投稿"> | |
# <input type="reset" value="書き直す"> | |
# </div> | |
# </form> | |
# </div> | |
# <div> | |
# <pre> | |
# #{messages} | |
# </pre> | |
# </div> | |
# </body> | |
# </html> | |
# EOF |
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require "cgi" | |
cgi = CGI.new | |
name = cgi["name"] | |
message = cgi["message"] | |
print cgi.header("text/html; charset=utf-8") | |
f = open("bbsdata.txt", "a:UTF-8") | |
f.write(name + " : " + message + "\n") | |
f.close | |
print <<EOF | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
書き込みました。 | |
<a href="https://cgi.u.tsukuba.ac.jp/~s2211482/wp/bbs.rb"> | |
掲示板へ | |
</a> | |
</body> | |
</html> | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment