To read the article online, visit

Creating an On-line Help System

Wouldn't it be nice to have a nifty on-line help system on your website? This help system would need to be fast loading, easy to navigate, pleasing to the eye, and, from an administrative perspective, easy to update. Well, look no further, for I am about to show you how to create a killer help system that's as easy as pie.

First things first, we don't need no stinkin' databases here! We will be using the FileSystemObject. If you are unfamiliar with the FileSystemObject, I strongly suggest you read the following articles first:

  • Reading/Writing Text Files
  • Text Files & ASP
  • In our help system, we will have just one ASP page, help.asp. This file will be responsible for displaying our help index file and the current help topic. The help index file is a text file. It lists each help topic and its associated file. Here is an example of a help index file:


    Using the Response Object
    Using the Request Object
    Impressing your Friends with ASP
    Opening Text Files with ASP

    The help index file is broken down into a number of two-lined entries. The first line is the title for the specific help file (i.e. Using the Response Object) and the second line immediately following the title is the name of the file that houses the help itself! For example, here's the contents of response.txt:


    <B>The Response Object:</B><BR>
    The Response Object is ASP's way of communicating with the HTML stream.
    If you want to send data to the HTML stream, you need to issue a
    <CODE>Response.Write</CODE> statement, such as:
    Response.Write "Hello, World!"
    Pretty easy, eh!?

    For each help topic you wanted to have, you would just need to create a text or html file similar to the one above. Save the file in the same directory as the help.asp and the other help topic files, and, lastly, add the title/URL to the help index file. Once you've completed those three steps, you're done!!! It's that easy to add new help topics! If you want to delete a help topic, simply remove its title/URL from the help index file. To modify an existing help topic, just edit the help topic file (for example, if we wanted to add more content to the Response help topic, we'd simply edit response.txt.

    It's time to bring it all together. We're going to do this by using a single file, help.asp. Please keep in mind that both the help index file and the help files, as well as the help.asp file, need to be in the same directory for help.asp to work as is. To the right you should see a cropped screen shot of the system in action. Note the help index listed on the left, and the current help topic listed on the right...


    <%@ Language=VBScript %>
    <% Option Explicit %>
    	Response.ExpiresAbsolute = Now() - 1
    	'The name of our help index file
    	Const HelpIndex = "helpIndex.txt"
    	'FSO constants
    	Const ForReading = 1
    	'We want to create one instance of a FileSystemObject
    	Dim fso
    	Set fso = Server.CreateObject("Scripting.FileSystemObject")
    	'This will be our file textstream variable
    	Dim fileTextStream
    	<!-- Left column, lists help topics -->
    		<FONT FACE=Arial>
    		<LI><A HREF="help.asp">Help Index</A><BR>
    		'This will hold the URL and Title
    		Dim strURL, strTitle
    		'Make sure the text file exists
    		If Not fso.FileExists(Server.MapPath(HelpIndex)) then
    			'Tell the user we can't find the help file...
    			Response.Write "The help index file could not be located."
    			'Open our help index file and show links to all of our
    			'help files...		
    			Set fileTextStream = fso.OpenTextFile(Server.MapPath(HelpIndex),ForReading)
    			While Not fileTextStream.AtEndOfStream
    				strTitle = fileTextStream.ReadLine
    				strURL = fileTextStream.ReadLine
    				Response.Write "<LI><A HREF=""help.asp?" & strURL & """>" & _
    								strTitle & "</A><BR>" & vbCrLf
    		end if
    		<!-- Show the header you always want to appear, here... -->
    		<CENTER><FONT SIZE=+2 FACE=Arial><B>
    			Help System
    		<FONT FACE=Arial>
    		'Now, we need to determine what file to load
    		Dim strFileName
    		strFileName = Request.QueryString
    		if Len(strFileName) = 0 then
    			'No querystring passed in, show default index %>
    			Welcome to the help system!  Choose a topic you want help on
    			from the list on the left!
    		<% else		
    			If Not fso.FileExists(Server.MapPath(strFileName)) then
    				'Tell the user we can't find the help file...
    				Response.Write "The help file " & strFileName & " could not be located."
    				Set fileTextStream = fso.OpenTextFile(Server.MapPath(strFileName),ForReading)
    				Response.Write fileTextStream.ReadAll
    			end if
    		end if
    		<!-- Add any standard footer here ... -->
    	'Clean up
    	Set fileTextStream = Nothing
    	Set fso = Nothing

    Nothing too difficult here. We use the QueryString to determine what help topic the user currently wants to view. We then open the appropriate file and display it! That's all there is to it! You can add a standard header and footer to the help topics by simply adding code where the comments talk about the header and footer.

    Happy Programming!


  • Download the source to help.asp

  • Article Information
    Article Title: Creating an On-line Help System
    Article Author: Scott Mitchell
    Published Date: Wednesday, July 07, 1999
    Article URL:

    Copyright 2019 QuinStreet Inc. All Rights Reserved.
    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers