changeset 529:f24e989eca53

選んだ性別と職に応じて画像を表示するプログラムとその画像プッシュ
author FUJIKAWA Kosuke <c111126@g.koeki-u.ac.jp>
date Wed, 25 Jun 2014 18:54:54 +0900
parents 3dc2480360a7
children f97a6a8bfeab
files minato2014/account.html minato2014/accountcheck.rb minato2014/hoge.rb minato2014/madousiB.png minato2014/madousiG.png minato2014/sensiB.png minato2014/sensiG.png minato2014/thiefB.png minato2014/thiefG.png minato2014/yumiB.png minato2014/yumiG.png
diffstat 11 files changed, 86 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/minato2014/account.html	Wed Jun 25 18:47:32 2014 +0900
+++ b/minato2014/account.html	Wed Jun 25 18:54:54 2014 +0900
@@ -11,12 +11,12 @@
 <body>
 <h1>帥鴻帥潟主脂蚊若</h1>
 <p>ュ</p>
-<form method="POST" action="./accountcheck.rb" accept-charset="utf-8">
+<form method="POST" action="./accountcheck.rb">
 <p>:<input name="name" type="text">(若)</p>
-<p><select name="sex">
-    <option>
-    <option>絅
-   </select></p>
+<p>:<select name="sex">
+	 <option value="B">
+	 <option value="G">絅
+	 </select></p>
 <p>綛岩撮:<select name="age">
 	 <option>10篁
 	 <option>20篁
@@ -31,10 +31,10 @@
 	 <option>紊 
 	 </select></p>
 <p>吾с:<select name="job">
-	 <option>紕
-	 <option>薛羈篏帥
-	 <option>綣篏帥
-	 <option>莖
+	   <option value="sensi">紕
+	   <option value="madousi">薛羈篏帥
+	   <option value="yumi">綣篏帥
+	   <option value="thief">莖
 	</select></p>
 <p>(傑キ筝荐吾ст吾с)</p>
 <input type="submit" value="OK">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/minato2014/accountcheck.rb	Wed Jun 25 18:54:54 2014 +0900
@@ -0,0 +1,34 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+
+#require 'sqlite3'
+require 'cgi'
+
+c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8")
+#db = SQLite3::Database.new("sql/stump.sq3")
+
+print("Content-type: text/html; charset=UTF-8 \n\n")
+
+name = c["name"]
+job = c["job"]
+sex = c["sex"]
+
+print'
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+	"http://www.w3.org/TR/html4/strict.dtd">
+
+<html>
+<head>
+<title>Registering Account</title>
+<link rel="stylesheet" type="text/css" href="design.css">
+</head>
+'
+printf'
+<p>脂蚊絎篋障筝荐潟鴻帥潟若若ユ筝!</p>
+<p><a href="hoge.rb?%s+%s+%s"> >> Let\'s go to Stamp Rally << </a></p>
+',name,job,sex
+print'
+<p></p>
+<p><a href="account.html"> >> ≪潟脂牙脂≪祉 << </a></p>
+'
+print'</body></html>'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/minato2014/hoge.rb	Wed Jun 25 18:54:54 2014 +0900
@@ -0,0 +1,43 @@
+#!/usr/bin/env ruby
+#coding:utf-8
+
+require 'cgi'
+require 'cgi/session'
+require 'nkf'
+
+cgi = CGI.new(:accept_charset=>"UTF-8")
+print("Content-type: text/html; charset=UTF-8\n\n")
+
+name = NKF.nkf('-w',ARGV[0])
+png = ARGV[1].to_s+ARGV[2].to_s
+png = NKF.nkf('-w',png)
+lv = 1
+
+printf(<<_EOS_,"","","","","","","","","")
+<html>
+<head>
+<title></title>
+
+</head>
+<body>
+<div class="main">
+<h1>鴻帥潟</h1>
+<table border="1">
+<tr><td>%s</td><td>%s</td><td>%s</td></tr>
+<tr><td>%s</td><td>%s</td><td>%s</td></tr>
+<tr><td>%s</td><td>%s</td><td>%s</td></tr>
+</table>
+_EOS_
+
+printf(<<_EOS_,name,png,lv)
+<div class="gazo">
+<p>%s</p>
+<img src="%s.png">
+</div>
+<div class="rpg">
+LV:%d
+</div>
+</div>
+</body>
+</html>
+_EOS_
Binary file minato2014/madousiB.png has changed
Binary file minato2014/madousiG.png has changed
Binary file minato2014/sensiB.png has changed
Binary file minato2014/sensiG.png has changed
Binary file minato2014/thiefB.png has changed
Binary file minato2014/thiefG.png has changed
Binary file minato2014/yumiB.png has changed
Binary file minato2014/yumiG.png has changed

yatex.org