php-guestbook/index.php

35 lines
670 B
PHP

<!DOCTYPE html>
<?php
require_once('persistence.php');
$db = createDB();
?>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Guestbook</title>
</head>
<body>
<?php
//storeMessage($db, 'Hola Dendy');
if(deleteMessage($db, 1)) {
echo('Success');
}
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/>');
}
?>
</body>
</html>