I'm trying to write a code for a very simple guestbook, where I get to manually review the comments before putting them on my site.
Here is the code for it:
CODE
<?php
$name = $_POST['name'];
$comments = $_POST['comments'];
$text= "./book.txt";
$fp = fopen($text, "a");
fwrite($fp, $name . " " . $comments);
fclose($fp);
?>
$name = $_POST['name'];
$comments = $_POST['comments'];
$text= "./book.txt";
$fp = fopen($text, "a");
fwrite($fp, $name . " " . $comments);
fclose($fp);
?>
And this is the input it's getting: guestbook.php?name=dghy&comments=egwekern where my test name is dghy, and the test comment is egwekern.
However, all I get as an output in book.txt is about 8 spaces.
If you want to see it in action, go to robertsworder.vndv.com/testing/guest.php, and then the file is at robertsworder.vndv.com/testing/book.txt.
Any help?
Thanks,
swordz