hi there,
i came across a basic php script for a guestbook and adapted it a little so it fits in with my layout, but when the form is filled out it doesn’t seem write the data to the guestbook.txt file, ive checked the permissions and the .txt file currently CHMOD’d to 666
heres a link to the page:
http://www.unearth-online.net/home.php?p=readbook
this is the script in the addbook.php page :
?php
if (get_magic_quotes_gpc()) {
$name = stripslashes($name);
$email = stripslashes($email);
$rating = stripslashes($rating);
$message = stripslashes($message);
}
if ($message != '')
{
$message = str_replace ("
","<br>",$message);
$message = strip_tags ($message, '<br>');
$newRow = '-------------------------------------------------------------------------------------------------------------------------------------------------' . ($message) . ' <br><br></td>' .
'</tr><tr><tr><td width="195" align="left" valign="top"><strong>Site Rating:</strong> ' . ($rating) . '/10</td>' .
'<td width="195" align="right" valign="top">posted on ' . date('d.m.y') . ' by <strong><a href="mailto:' . ($email) . '" class="links"> ' . ($name) . '</a></strong></td></tr></table><br>';
$oldRows = join ('', file ('guestbook.txt') );
$fileName = fopen ('guestbook.txt', 'w');
fputs ($fileName, $newRow . chr(13) . chr(10) . $oldRows);
fclose ($fileName);
}
include ("readbook.php");
?>
and i have the form action set to this :
<form action=“home.php?p=addbook” method=“post”>
any ideas? if anyone needs some more info i can post it up.
Cheers