Displaying Guest Book List On Web Browser Using PHP

Two days ago, I’ve just making tutorial about how to make guest book in PHP and how to save it in a single text document. But, in this time I’d like to show how to display all of guest which is already visit the web site on web browser it self. Actually, it is only the continue of file processing chapter in PHP. And , this is a little bit implementation about it.

Alright, here is the source code :


<?php

$namafile="bukutamu.txt";

$fo=fopen($namafile,'r');

while(!feof($fo)){

$baca=fgets($fo,2048);

echo "$baca <br />";

}

?>

The ‘r’ parameter means that the file named “bukutamu.txt” is opened using mode read because I only want to display the content of it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: