Help - Search - Members - Calendar
Full Version: Simple Guestbook
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
swordz
Hi.

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);
?>


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
swordz
I've solved it, so don't worry.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.