Location: PHPKode > scripts > Piece Of Cake Guestbook > piece-of-cake-guestbook/getguestbook.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Guestbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Markgreat Free Guestbook">
<meta name="keywords" content="Guestbook, Free Guestbook, Free Guestbook by Markgreat, Markgreat free guestbook">
<META NAME="AUTHOR" CONTENT="hide@address.com">
<META NAME="OWNER" CONTENT="hide@address.com">
<META NAME="RATING" CONTENT="BUSINESS">
<META NAME="REVISIT-AFTER" CONTENT="10 DAYS">
<META NAME="LANGUAGE" CONTENT="EN">
<META NAME="COPYRIGHT" CONTENT="markgreat ltd">
<META NAME="ROBOTS" CONTENT="index,follow">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<style type="text/css">
body { FONT-FAMILY: Arial;
scrollbar-face-color: #000066; scrollbar-shadow-color: #000066;
scrollbar-highlight-color: #000066; scrollbar-3dlight-color: #CCCCFF;
scrollbar-track-color: #000099; scrollbar-arrow-color: #CCCCFF;}
</style>
</head>

<body bgcolor="#000099">
<?php

$filename = "guest_max.txt";
($fp = fopen($filename, "r")) or die ("Cannot open the file - guest_max.txt - Unable to continue");
$guest_max = fgets( $fp, 200);
fclose ($fp);

$filename2 = "guest_next.txt";
($fp2 = fopen($filename2, "r")) or die ("Cannot open the file - guest_next.txt - Unable to continue");
$guest_next = fgets( $fp2, 200);

if ($guest_next < 1 ) {
   $guest_next = $guest_max;
}
$filename3 = $guest_next;
$filename3 .="guest_book.txt";
($fp3 = fopen($filename3, "r")) or die ("Cannot open the file - $filename3 - Unable to continue");
$fsize = filesize($filename3);
if ($fsize > 0) {
$flash_vars = fgets( $fp3, ($fsize));
} else {
$flash_vars ="";
}
$flash_vars = stripslashes($flash_vars);
$flash_vars = ereg_replace("=","1=",$flash_vars);
print "next\n\n";
echo "&guest_next=$guest_next&guest_max=$guest_max";
echo "$flash_vars";
print "\n\n";
$guest_next = $guest_next - 1;
if ($guest_next < 1 ) {
   $guest_next = $guest_max;
}
$filename3 = $guest_next;
$filename3 .="guest_book.txt";
($fp3 = fopen($filename3, "r")) or die ("Cannot open the file - $filename3 - Unable to continue");
$fsize = filesize($filename3);
if ($fsize > 0) {
$flash_vars = fgets( $fp3, ($fsize));
} else {
$flash_vars ="";
}
$flash_vars = stripslashes($flash_vars);
$flash_vars = ereg_replace("=","2=",$flash_vars);

echo "$flash_vars";
print "\n\n";
$guest_next = $guest_next - 1;
if ($guest_next < 1 ) {
   $guest_next = $guest_max;
}
$filename3 = $guest_next;
$filename3 .="guest_book.txt";
($fp3 = fopen($filename3, "r")) or die ("Cannot open the file - $filename3 - Unable to continue");
$fsize = filesize($filename3);
if ($fsize > 0) {
$flash_vars = fgets( $fp3, ($fsize));
} else {
$flash_vars ="";
}
$flash_vars = stripslashes($flash_vars);
$flash_vars = ereg_replace("=","3=",$flash_vars);
echo "$flash_vars";
print "\n\n";
echo "&dummy=dummy to keep last var ok";
?>

</body>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</html>
Return current item: Piece Of Cake Guestbook