view delete.rb @ 815:b506b3511671

pass2 acc -
author ARAKI Tsuyohito <c113007@e.koeki-u.ac.jp>
date Mon, 20 Jul 2015 18:13:46 +0900
parents 05303d4b8344
children
line wrap: on
line source

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require 'sqlite3'
require 'cgi'

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

c = CGI.new(:accept_charaset => "UTF-8")
check = c['check']
if check = "OK"
  begin
    db.execute("drop table main;")
    db.extcute("drop table logs;")
    text = "<p>データを削除しました。</p>"
  rescue
    text = "<p>データがありません。</p>"
  end
else
  text = "データは削除されません"
end

printf("Content-type: text/html; charset=UTF-8\n\n")

printf'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Delete table</title>
<link rel="stylesheet" type="text/css" href="design.css">
</head>
</body>
%s
<p><a href="etsuran.rb">データ閲覧ページへ</a></p>
<p></p>
</body></html>
',text

yatex.org