Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

info.cgi

日記閲覧
  • Loading branch information...
commit 736177df1fa6355059b12fdea6ee9f05c96b031c 1 parent 7dd34d5
@nontan nontan authored
Showing with 78 additions and 0 deletions.
  1. +78 −0 info.cgi
View
78 info.cgi
@@ -0,0 +1,78 @@
+#!/usr/bin/perl
+
+require './common.pl';
+use strict;
+use DBI;
+
+# データベース接続
+my $conn = Common::ConnectDB();
+
+my $sql = "
+select
+entry_title,
+entry_text,
+entry_time
+from
+entry
+";
+
+# データベース読み込み
+my $select = $conn->prepare($sql);
+my $rec = $select->execute;
+if(!$rec)
+{
+Common::DspMsg("データベースエラー : " . $sql);
+exit;
+}
+
+# データベースクローズ
+Common::CloseDB($conn);
+
+print "Content-type: text/html\n\n";
+
+print << "END_OF_HTML";
+<html>
+<body>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<meta http-equiv="Content-Script-Type" content="text/javascript" />
+
+<!--viewportの指定-->
+<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" />
+<!--/viewportの指定-->
+<!--メディアクエリでPC用・スマホ用CSSを振り分け-->
+<link media="only screen and (min-device-width:481px)" href="style.css" type="text/css" rel="stylesheet" />
+<link media="only screen and (max-device-width:480px)" href="istyle.css" type="text/css" rel="stylesheet" />
+<!--/メディアクエリでPC用・スマホ用CSSを振り分け-->
+
+<link href="style.css" type="text/css" rel="stylesheet" />
+
+</head>
+<div id="contents">
+
+<div id ="wrapper">
+
+<img src="images/line.gif" /><br><br>
+<div id="entry_contents">
+<br>
+END_OF_HTML
+my (@user);
+while (@user = $select->fetchrow) {
+print $user[0] . "<br><br>" . $user[1] . "<br>";
+print $user[2];
+}
+
+print << "END_OF_HTML";
+
+</div>
+</div>
+</div>
+
+
+
+</body>
+</html>
+END_OF_HTML
+
+exit;
Please sign in to comment.
Something went wrong with that request. Please try again.