<br><br>
<center><h2>Entries</h2></center>
- <table border="1" cellspacing="" width="600">
- <tr>
- <th>Name</th>
- <th>Country</th>
- <th>Web site</th>
- <th>Comment</th>
- </tr>
- <?php
- if($result && $result->num_rows > 0){
- while($row = $result->fetch_assoc()){
- echo "<tr>";
- echo "<td>" . htmlspecialchars($row['name']) . "</td>";
- echo "<td>" . htmlspecialchars($row['country']) . "</td>";
- if(!empty($row['website'])){
- echo "<td><a href='" . htmlspecialchars($row['website']) . "' target='_blank'>" . htmlspecialchars($row['website']) . "</a></td>";
- } else{
- echo "<td></td>";
+ <table cellspacing="7" cellpadding="3" width="500" bgcolor="#0087fc">
+ <?php
+ if($result && $result->num_rows > 0){
+ while($row = $result->fetch_assoc()){
+ $name = htmlspecialchars($row['name'] ?? '');
+ $country = htmlspecialchars($row['country'] ?? '');
+ $website = htmlspecialchars($row['website'] ?? '');
+ $email = htmlspecialchars($row['email'] ?? '');
+ $comment = htmlspecialchars($row['comment'] ?? '');
+ $written_at = $row['written_at'] ?? '';
+ $ip_addr = $row['ip_addr'] ?? '';
+
+ echo "<tr>";
+ echo "<td>";
+ echo "By <b>$name</b> at <b>$written_at</b><br>";
+ echo "Country: <b>$country</b><br>";
+ echo "Website: <b><a href='$website'>$website</a></b><br>";
+ echo "Message: <b>$comment</b>";
+ echo "<hr>";
+ echo "</td>";
+ echo "</tr>";
}
- echo "<td>" . htmlspecialchars($row['comment']) . "</td>";
- echo "</tr>";
- }
- }
- ?>
+ } else{
+ echo "<tr><td>No entries yet.</td></tr>";
+ }
+ ?>
</table>
<br><br>