Newer
Older
skip-web / archive / program / GiveMeALiftInYourCar / check_table.rb
#!/usr/bin/env ruby
# coding: utf-8

require 'sqlite3'
require 'cgi'

c = CGI.new(:tag_maker => "html4", :accept_charset => "EUC-JP")

db = SQLite3::Database.new("sql/acounts.sq3")

sql = "select sub_name, password from acounts;"
value = db.execute(sql)

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>トップページ -koeki network-</title>
<style type="text/css">
<!--

-->
</style>
<link rel="stylesheet" type="text/css" href="group.css">
</head>
<body>
<div class="base">
<h1 ><img class="kn" src="koeki-network.png" alt="300x167(14204bytes)" width="300" height="120">
</h1>
<div class="bb">
<table>
<tr><th>sub_name</th><th>pass</th></tr>
'
value.each { |data|
  printf('
<tr><td>%s</td><td>%s</td></tr>
', data[0], data[1])
}
# フッダ−
print'
</table>
</div>
<hr>
<a class="cont" href="./top.rb?vis_log=out">ろぐあうと。</a>
<a class="cont" href="./login.html">ほかのアカウントでログイン。</a>
<address>c112124&#x40;h.koeki-u.ac.jp</address>
</div>
</body>
</html>
'