php-guestbook/index.php

35 lines
670 B
PHP
Raw Normal View History

2021-12-10 20:22:06 +00:00
<!DOCTYPE html>
2021-12-10 23:53:23 +00:00
<?php
require_once('persistence.php');
$db = createDB();
?>
2021-12-21 19:28:43 +00:00
<html lang="en">
2021-12-10 20:22:06 +00:00
<head>
2021-12-10 22:54:03 +00:00
<meta charset="utf-8"/>
<title>Guestbook</title>
2021-12-10 20:22:06 +00:00
</head>
<body>
2021-12-21 19:28:43 +00:00
2021-12-10 23:53:23 +00:00
<?php
2021-12-21 19:28:43 +00:00
//storeMessage($db, 'Hola Dendy');
if(deleteMessage($db, 1)) {
echo('Success');
2021-12-10 23:53:23 +00:00
}
2021-12-21 19:28:43 +00:00
else {
echo('Failure');
}
$test = getMessages($db);
foreach($test as $msg) {
echo('<div class="message">');
foreach($msg as $key => $value) {
echo('<div class="content">');
echo("$key: $value");
echo('</div>');
}
echo('</div>');
echo('<br/>');
}
2021-12-10 23:53:23 +00:00
?>
2021-12-10 20:22:06 +00:00
</body>
</html>