small guestbook play-up<

windows

Guest
i have a guestbook with the following short code:

the form:

<form action="index.php?id=gb_addbook" method="post">name<br>
<input type="text" name="name" class="textfields"><br>email<br>
<input type="text" name="email" class="textfields"><br>url<br>
<input type="text" name="url" class="textfields" value="http://"><br>message<br>
<textarea name="message" cols="30" rows="7" class="textfields"></textarea><br>
<input type="submit" value=" submit " class="textbox">
</form>

leading to gb_addbook:

<?php
if ($message != '')
{
$message = str_replace ("\n","<br>",$message);
$message = str_replace ("\'","'",$message);
$message = strip_tags ($message, '<br>');

$newRow = '<b>' . strip_tags ($name) . '</b> - [<a href=http://www.htmlforums.com/archive/index.php/mailto:' . strip_tags ($email) . '>email</a>] [<a href='http://www.htmlforums.com/archive/index.php/. strip_tags ($url) .' target=_top>website</a>] ' . date('d.m.Y') . '<br>' . ($message) .

'<br><hr>';

$oldRows = join ('', file ('gb_guestbook.txt') );
$fileName = fopen ('gb_guestbook.txt', 'w');
fputs ($fileName, $newRow . chr(13) . chr(10) . $oldRows);
fclose ($fileName);
}

include ("gb_readbook.php");
?>

and gb_readbook simply includes gb_guestbook.txt (probably unnescessary, but hey..

the trouble recently is that the $name variable is overwritten with "gb_addbook.php"
(view here (<!-- m --><a class="postlink" href="http://mng.zer0host.com/index.php?id=gb_readbook">http://mng.zer0host.com/index.php?id=gb_readbook</a><!-- m -->)). i don't know what has been edited/fiddled with to cause this to happen.

any help is greatly appreciated :)

added: looking at the code i see it's very cluttered and doesné–¶
 
Back
Top