Commit aac957bc authored by 君塚 悠's avatar 君塚 悠

プログラム作成(guest_read.php,guest_read_r2.php:ゲストブック表示)

parent 8d40574b
<html>
<head>
<title>ゲストブック</title>
</head>
<body>
<h1 style="background: #cccccc">ゲストブック(閲覧)</h1>
<?php
$file = fopen("guest.dat", "r");
while ($row = fgetcsv($file, 104, "\t")) {
?>
<ol>
<li>お名前:<?php print($rou[1]); ?></li>
<li>メッセージ:<?php print($row[2]); ?></li>
<li>書き込み日時:<?php print($rou[0]); ?></li>
</ol>
<hr />
<?php
}
fclose($file);
?>
</body>
</html>
\ No newline at end of file
<html>
<head>
<title>ゲストブック</title>
</head>
<body>
<?php
$file = fopen("guest.dat", "r");
while ($row = fgetcsv($file, 104, "\t")) {
($data[] = $row);
}
fclose($file);
?>
<h1 style="background: #cccccc">ゲストブック(閲覧)</h1>
<?php foreach (array_reverse($data) as $datum) { ?>
<ol>
<li>お名前:<?php print($rou[1]); ?></li>
<li>メッセージ:<?php print($row[2]); ?></li>
<li>書き込み日時:<?php print($rou[0]); ?></li>
</ol>
<hr />
<?php
}
?>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment