Mercurial > hgrepos > hgweb.cgi > skipweb
changeset 545:785e500c8003
login page add
author | FUJIKAWA Kosuke <c111126@g.koeki-u.ac.jp> |
---|---|
date | Fri, 18 Jul 2014 15:44:16 +0900 |
parents | de44297cdfaf |
children | 0ab1a0f141d7 |
files | minato2014/account.html minato2014/accountcheck.rb minato2014/design.css minato2014/rain.png |
diffstat | 4 files changed, 35 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/minato2014/account.html Thu Jul 17 21:19:49 2014 +0900 +++ b/minato2014/account.html Fri Jul 18 15:44:16 2014 +0900 @@ -1,15 +1,14 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> - <html> <head> -<title>デザイン用サンプル</title> +<title>ゆるスタ登録ページ</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="design.css"> </head> <body> -<h1>みなとスタンプラリー登録ページ</h1> +<h1>ゆるスタ登録ページ</h1> <p>入力してね</p> <form method="POST" action="./accountcheck.rb"> <p>名前:<input name="name" type="text">(ニックネーム)</p> @@ -25,7 +24,7 @@ <option>50代 <option>60代以上 </select></p> -<p>出身地:<select name="home"> +<p>出身地:<select name="aria"> <option>酒田市内 <option>山形県内 <option>県外 @@ -36,8 +35,9 @@ <option value="yumi">弓使い <option value="thief">盗賊 </select></p> -<p>(あなたの職業を上記のジョブで例えて選んでください)</p> -<input type="submit" value="OK"> +<p>(好きな職業を選んでください)</p> +<input type="submit" value="OK"><br> +<img src="rain.png" width="" height="画像の高さ" alt="代替テキスト"> </form> </body> </html>
--- a/minato2014/accountcheck.rb Thu Jul 17 21:19:49 2014 +0900 +++ b/minato2014/accountcheck.rb Fri Jul 18 15:44:16 2014 +0900 @@ -1,34 +1,48 @@ #!/usr/bin/env ruby # -*- coding: utf-8 -*- -#require 'sqlite3' +require 'sqlite3' require 'cgi' c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8") -#db = SQLite3::Database.new("sql/stump.sq3") +db = SQLite3::Database.new("sql/stump.sq3") -print("Content-type: text/html; charset=UTF-8 \n\n") +begin + result = db.execute("select * from main;") +rescue + db.execute("create table main(id PRIMARY KEY,name,sex,age,aria,job,stamp_status,stamp_img,exp,rank,magic)"); + db.execute("insert into main values('ID','名前','性別','年代','住所','職業','スタンプ状況','スタンプ画像','レベル','当選順位','本人確認用')"); + result = db.execute("select * from main"); +end name = c["name"] -job = c["job"] -sex = c["sex"] +job = c["job"] +age = c["age"] +sex = c["sex"] +aria = c["aria"] + +id = result.length +printf("%04d",id) -print' -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" +mg = 0 + +sql = "insert into main values (?,?,?,?,?,?,?,?,?,?,?);" +db.execute(sql,id,name,aria,sex,age,job,'000010000','n,n,n,n,kamo,n,n,n,n','0','0',mg); #初期値 + +printf("Set-Cookie:id=%d; magic=%s\n",id,mg) +print"Content-type: text/html; charset=UTF-8 \n\n" + +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> -' +</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><a href="hoge.rb"> >> Let\'s go to Stamp Rally << </a></p> <p></p> <p><a href="account.html"> >> アカウント登録画面に戻る << </a></p> +</body></html> ' -print'</body></html>'