Code: Select all
<table>
<tr>
<?php
$fp = fopen( 'guestbook.txt', 'w');
$files = glob("entrys/*.txt");##Display $filesforeach ($files as $key){ echo "<td>" . include($files) . "</td>; echo
echo "<form method" . "POST" . "action=" . $_SERVER['PHP_SELF'] . ">";
echo "<tr>" . "<td>" . "<h2>" . "Yes" . "</h2>" . "<br>" . "</td>";
echo "<td>" . "<input type=" . "radio" . "name=" . "yes" . ">" . "<br>" . "</td>" . "</tr>";
echo "<tr>" . "<td>" . "<h2>" . "No" . "</h2>" . "<br>" . "</td>";
echo "<td>" . "<input type=" . "radio" . "name=" . "no" . ">" . "<br>" . "</td>" . "</tr>";
?>
<input type="submit" value="submit for addition to guestbook" name="guestbook">
</form>
</tr>
</table>
<?php
if($_POST['name'] = "no") {
unlink ($files);
} else {
fwrite($fp, $files);
fclose($fp);
}
?>