GuestBook

Guestbook is empty!

0); $days = $DAYS; endif>

Show entries for the past days. (0 = All entries)

"; /* Title switch */ switch($days); case 0; echo "Showing all entries"; break; case 1; echo "Showing today's entries"; break; case 2; echo "Showing entries for today and yesterday"; break; default; echo "Showing entries for the past $days days"; break; endswitch; echo ""; echo "
"; /* Now open the actual dbm file */ dbmopen($fn,"r"); $i=0; /* First we load in all the keys that match the viewing criteria */ $getkey = dbmfirstkey($fn)> =0); /* Look up the key */ $entry = dbmfetch($fn,$key[$j]); /* Fields are separated by ESC chars, so tokenize on char 27 */ $name = strtok($entry,27); $email = strtok(27); $comment = strtok(27)> <> <entry id: >

[Top] [Read] [Admin]
Sorry, this guestbook already has a password

[Top] [Read] [Admin]
Password registered!

There is no password set for this guestbook. Please set one.

Sorry, wrong password.

[Top] [Read] [Admin]

Administrative Screen

Delete all entries older than days.
entry id:
Change password to:
"; break; case "delete"; dbmopen($fn,"w"); $dkey=dbmfirstkey($fn); $i=0; while($dkey); $age = intval(date("Yz")) - intval(date("Yz",$dkey)); if($age > $GUESTBOOKARG); $dead[$i] = $dkey; $i++; endif; $dkey = dbmnextkey($fn,$dkey); endwhile; $j=0; while($j<$i); dbmdelete($fn,$dead[$j]); $j++; endwhile; dbmclose($fn); echo "$i entries deleted

"; break; case "change_password"; dbmopen($fn,"w"); dbmreplace($fn,"GUESTBOOKPASS",$GUESTBOOKARG); dbmclose($fn); echo "Password changed

"; break; case "edit"; dbmopen($fn,"r"); $entry=dbmfetch($fn,$GUESTBOOKARG); dbmclose($fn); if(!$entry); echo "Entry not found

"; else; $name = strtok($entry,27); $email = strtok(27); $comment = strtok(27)>

Name


E-Mail


Comment


"; break; endswitch; endif>
[Top] [Read] [Admin]
Please enter your guestbook admin password:
Fill in the fields below to leave an entry in the guestbook. Or you may Read the Guestbook. The owner of this guestbook may Adminstrate the Guestbook.
Name


E-Mail


Comment


This is a new guestbook. Please select an administrative password for this guestbook. You will need this password to manipulate the guestbook later on.

Thank you, your entry has been added.

[Top] [Read] [Admin]