% '******************************************************* '* ASP 101 Sample Code - http://www.asp101.com/ * '* * '* This code is made available as a service to our * '* visitors and is provided strictly for the * '* purpose of illustration. * '* * '* http://www.asp101.com/samples/license.asp * '* * '* Please direct all inquiries to webmaster@asp101.com * '******************************************************* %> <% ' This is used to control whether or not we empty the guestbook at ' the first hit after midnight. We do it just to keep the list ' short. You'll probably want to set this to False Const bDeleteEntries = True ' Allows us to easily clear the guestbook if we notice someone is ' getting rude! All you need to do is pass it ?force=anything ' Possibly something else you might not want. To disable it comment ' out the Request.QueryString line and uncomment the "" one. Dim bForce bForce = Request.QueryString("force") 'bForce = "" ' Now that we're done implementing features you probably won't want, ' let's get to the actual script... Dim strFile ' String variable to store the path / file we write to ' I use MapPath here to make the script somewhat location independent. ' If I specified the physical path, you'd need to edit it to run this ' on your own server. This way it should work fine as long as it's in ' the same directory as the guestbook file. The include line also ' needs to be changed if you change this! This file needs to exist ' BEFORE you run this script! strFile = Server.MapPath("guestbook.txt") ' If the script doesn't have anything posted to it we display the form ' otherwise we process the input and append it to the guestbook file. If Request.Form.Count = 0 Then ' Display the entry form. %>
![]() |
|
|