Creating a Guestbook, Part 2By Joshua Bengal
In Part 1 we looked at the source code for
Submit.asp, two Web pages that allowed users to add a new guestbook entry. In this part we will
Guestbook.asp, the ASP page that displays the guestbook in its entirity.
This file contains the header of our guestbook page (you know, that cheezy text we all love to put there, as well as any banners and titles we may want) and then writes out the contents of
entries.dat. Note: If you wanted to make a nifty little "View my guestbook" link so people could
see the entries without signing in, you would link it to this file.
By now we should all be experts at basic file manipulation, so I'll just put this code here without explanation and see if you can handle it.
And there you have it, your own little ASP guestbook. In real life, I made mine a little more complex (I check to see if URL and email were entered, and if they were I linked the names and email address to them) but this is pretty much the basic idea. And stick my name (Joshua Bengal, for those who don't notice author's) somewhere in the code so I can feel proud.
To see this guestbook in action, swing on over to http://www.joshuabengal.com and sign my guestbook. Have fun! If you have any questions/comments/praise/money, feel free to write me at email@example.com.