It doesn't use a database, it just uses normally txt files to save the entries in.
I want to clear the guestbook when ever it gets spammed etc (or well, thats not really the problem, just so i can learn some PHP)
I've read up on it..and came up with this script
<?php
$filename = 'test.txt';
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'w')) {
echo "<h1>Cannot open file ($filename)</h1>";
exit;
}
echo "<h1>Success, $filename has been cleared :)</h1>";
fclose($handle);
} else {
echo "<h1>The file $filename is not writable</h1>";
}
?> It's my first php script so it might not be 100%correct.The question is.
Is there anyway i can create a button which would then call the php function which wouild then clear the txt file? if that makes sense?
