This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 出力形式、文字コードの指定 | |
header('Content-type: text/html; charset=UTF-8'); | |
// 必要パッケージの読み込み | |
require_once('jpgraph/jpgraph.php'); | |
require_once('jpgraph/jpgraph_bar.php'); | |
// データの設定 | |
$datax=array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 日本語の文字コード設定などを予め定義 | |
mb_internal_encoding("UTF-8"); | |
mb_language("ja"); | |
setlocale(LC_ALL,"ja_JP.UTF-8"); | |
// csv | |
$bbs_file = "bbs.csv"; | |
// エスケープを行うラップ関数を定義 | |
function h($str) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include("common2.php"); ?> | |
<?php include("formhelpers.php"); ?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ひよこ掲示板 </title> | |
<meta charset="utf8"> | |
<style> | |
body { | |
background-color: #f0e6ac; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop table if exists bbs; | |
create table bbs | |
(post_id int primary key, | |
name varchar(20) , | |
comment varchar(400), | |
time datetime | |
) engine=innodb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load the form helper functions. | |
require 'formhelpers.php'; | |
// 部門番号の選択 | |
$deptno_choices = array(); | |
$dsn = 'mysql:dbname=testphp;host=localhost'; | |
$user = 'test'; | |
$password = 'pass'; | |
try{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load the form helper functions. | |
require 'formhelpers.php'; | |
// 部門番号の選択 | |
$deptno_choices = array(); | |
$dsn = 'mysql:dbname=testphp;host=localhost'; | |
$user = 'test'; | |
$password = 'pass'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load the form helper functions. | |
require 'formhelpers.php'; | |
$db = mysqli_connect('localhost','test','pass','testphp'); | |
if (! $db) { die("Can't connect: " . mysqli_connect_error()); } | |
// 部門番号の選択 | |
$deptno_choices = array(); | |
$sql = 'select deptno from departments order by deptno'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load the form helper functions. | |
require 'formhelpers.php'; | |
$db = mysqli_connect('localhost','test','pass','testphp'); | |
if (! $db) { die("Can't connect: " . mysqli_connect_error()); } | |
// 部門番号の選択 | |
$deptno_choices = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load PEAR MDB2 | |
require 'MDB2.php'; | |
// Load the form helper functions. | |
require 'formhelpers.php'; | |
require 'connect_mysql.php'; | |
// Connect to the database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load PEAR MDB2 | |
require 'MDB2.php'; | |
// Load the form helper functions. | |
require 'formhelpers.php'; | |
require 'connect_mysql.php'; | |
// Connect to the database |