By William LaMartin, Editor, Tampa PC Users Group
LaMartin.Com
Last month I wrote briefly about my new web site at http://www.lamartin.com (http://lamartin.com will work just as well). I noted that I needed a place to try out my ideas separate from our groups site. Over the past two years I have devoted a lot of time to what is now http://www.tpcug.org, building what I think is a pretty good user group site. However, the user group site is hardly the place for me to post genealogical and historical data, photographs of interest to me, and other such things. Hence lamartin.com, which has been up and running for about a month. I have added a lot to it since I first mentioned it in last month's newsletter.
What is there will probably be of little interest to most people. Certainly the few individuals I have heard from who have found information about their ancestors there are interested and in some cases extremely grateful to be given information and photos they didn't know existed. A slightly larger number may find the old photos of the Okeechobee, Florida area interesting. And more probably will consider the Mardi Gras and Louisiana photos worth at least one look. But what could I add that would be of interest to a larger audience?
My first attempt at a general interest item is the online grocery list compiler that allows you to select from a list of about 260 items those you wish to purchase at the grocery store. After making your selection and adding any comments, you can submit your list, which will then be displayed on screen to be printed out and taken to the store. If you happen to live near my part of Tampa, Florida, you will want to take advantage of the additional opportunity to have the list of items selected displayed in walking order of one of four stores I have an order for in that part of town.
In the future, I shall reduce the number of items in the master list. There is really no need for Aluminum Foil and Aluminum Foil (Large), for example, since such differences can be noted in the comment text box next to each item. The big challenge is to come up with some scheme to allow users to do a one-time ordering of the items for the store they shop frequently. It wouldn't be as precise as the ordering I have for the four stores listed, but would rather be based on the order in which such general categories as fresh vegetables/fruit, meat, dairy, etc. appear. Once you had established such an order it could possibly be saved as a "cookie" (greatly feared by Microsoft conspiracy buffs) on your machine so that you wouldn't have to reorder the next time you visit the site. Possibly I will have that ready for next month (I need something to write about).
Active Server Pages (ASP)
So how did I create the online grocery compiler? If you have never done any work with HTML pages the pages you view when you browse the WWW then you may not think there is any more to be done than with a normal page one with some text and a few pictures. And actually you are correct as regards the appearance of the page that displays the 261 grocery items, each with a check box for selection and a text box for comments. That page could all have been done with standard HTML coding. But it would have taken a long time. For each item you would need a line like
<
input type="checkbox" name="C1" value="ON>Aluminum Foil<input type="text" name="T1" size="40">When finished, you would have 261 such lines. No one would want to do this 261 times, each time changing Aluminum Foil to the correct item name, C1 and T1 to different names. That is where ASP enters the picture. ASP allows you to combine Visual Basic Script (similar to Visual Basic) with standard HTML coding to enable the server to dynamically create web pages. The code to create those 261 lines is as follows:
<p><
% ' Now lets input the data from the databaseI am sure to some, perhaps, most of the readers, the above is gibberish. First, the <% tags are used to indicate VB script. Then, what we are doing is stepping through a database table called rstemp and retrieving the grocery item name part of each record. We then create a check box on the page, insert the item name, and finally create a text box on the page. The loop allows us to do this for each record of the database table (261 times at present).
Before executing the above VB script, though, we had to first open the database table. This was done on the ASP page with code like
<
%set conntemp=server.createobject("adodb.connection")This code was run when the page was first loaded, so that a database with my store data is now temporarily called rstemp and is ready for use. rstemp(0) is the first field of whatever record we happen to be on; rstemp(1) is the second field but is not used in the present example. If i = 0 (the first record) then rstemp(0) = "Aluminum Foil".
After being processed by the server, the above mixture of VB script and HTML code produces 261 lines of HTML code producing a check box, item name, and text box for each line. Later, if you change any items in the database, the next time the page is loaded, those changes will appear on the page. This is how the list of items is generated. Note the VB script is being run on the server, not the client's browser. This is termed server side scripting as opposed to client side scripting (run on the client's machine). An example of client side scripting is the Java script that is used on the TPCUG home page to display the scrolling announcement at the bottom of the screen. Another is the Java script on the TPCUG Announcements page that gives a count down to Year 2000 which I bet you haven't even noticed.
To get a list of his selections, the user checks the items wanted, makes any comments desired in the text boxes, selects to receive either an alphabetical list of selected items or one in walking order of one of four South Tampa stores, then presses the submit button on the page. When the next page appears it again is an ASP page and displays the results by using VB scripts to display only those items selected along with the appropriate query from the database to display them in walking order of the particular store selected. There is no way this page could have been done with standard HTML.
Thus, when your browser tries to access an ASP page, the server steps in, reads the combination of HTML code and VB Script (or Java Script), does any calculations required and returns to the browser a stream of HTML code that is used by the browser to display the page. If you do a view source on the page, you will only see the resulting HTML--not the original combination of VB Script and HTML.
My first use of ASP was to create a user name and password protected collection of pages at another site. You can see how this would work. When you initiate a session at the site, the ASP page induces the server to make a note that you have begun a session and ask for your user name and password. It then "follows" you around making sure that you have permission to visit any other ASP pages that have been tagged as restricted. This allows you to set up password protection on your own without having to give a list of people and passwords to the server administrator.
Now that I had this new tool, I needed to think of ways to use it. One idea that came to mind was an online mortgage payment calculator. Given the principal amount, interest rate, and term, it would first display the fixed monthly payment, then display for each month the portion of the monthly payment going to interest and the portion going to principal, along with the remaining balance. I did it locally on my computer. Then I had to decide if I should put it at my site. Was the world crying out for such a thing? I have seen loan payment calculators all over the Internet but haven't seen one that lists where you stand for each period (month) of the loan. So, you can now find a loan calculator at http://www.lamartin.com.
Whats next, an online income tax calculator? It could be done, I am sure, for simple returns. However, the number of options to be considered for more complicated returns is mind boggling.
ASP on your Computer
A web developer should always test out his new creations locally before posting them to the WWW. That introduces the question of how you test out ASP pages on your local setup. First, you need for your computer to act as a server. If you are using Windows 95/98, the easiest way to accomplish this is to download for free from Microsoft their Personal Web Server (PWS). After you install the PWS, you can locally host a web site. In fact, while connected to the Internet, if you give out your temporary Internet address, anyone in the world can connect to your computer and view whatever HTML files you have set up in the PWS's directory. The PWS also has FTP capability, and I have used it to allow others to send files to and receive files from my computer via the Internet. If you have Microsoft FrontPage, it will install PWS as part of the FrontPage installation.
The next thing you will need is an ASP engine. Microsoft also provides this for free. The file is ASP.exe, if I recall correctly. You may download it or, if you have FrontPage 98, copy it from that CD. After you run this file, you should have the ability to host an ASP setup on your local PWS. The final thing you will need is a database like Microsoft Access if you want to use a database file as I did in the grocery list compiler (note the mortgage payment calculator doesn't use a database). To set up the particular database file, you move the file to your local web directory in PWS, then run the 32bit ODBC entry in Control Panel and tell it the name of the data base and where it is located. When you move everything to the Internet, you will have to have your server administration do this last thing for you. And that bring us to:
ASP on the Internet
If you are hosting your site on an NT server running IIs, then you probably have everything already set up for ASP pages. You just need to set the folders containing the ASP pages as executable (that is, scripts can be run). If you want the ability to access a database with the ASP pages, you will have to ask your server administrator to set it up and possibly pay an extra fee. If you are hosting your site on a UNIX server, it is possible to use ASP pages but not guaranteed. It depends on the software they are using.
Help on ASP Usenet Newsgroups
If you want to learn how to use ASP, where do you go? I suppose you could buy a book, but that is not my method of late. What I did first was search the Microsoft site for articles on ASP and VB Script. I found a few, one particularly good one on setting up an ASP page to access a database. But I needed more information especially examples. I then turned to the source of much of my computer help, the Usenet Newsgroups that you read using your mail reader (same as the email program). Interest in ASP not being all that great, I was only able to find one newsgroup: microsoft.public.inetserver.iis.activeserverpages. But it was loaded with information. Not only did I learn from reading the questions and answers posted there, but I was also directed to several WWW locations that specialized in APS. People on the Internet, I have found, are very happy to share their knowledge on different aspects of computing. For now, this particular newsgroup and the WWW locations I have found will be my tutorial on learning ASP.
Since I have found them so useful, I want to fill in the rest of the empty space in this month's newsletter writing about the Usenet newsgroups. Part of an editor's job is filling up all the space left over after including all the articles that members have submitted. Of course, I could move from 10-point type to 12-point and that would do the job nicely, but I prefer to add content and stick with the 10-point type.
To be able to read newsgroups, you first have to set up the your mail reader so that it knows where on your Internet Provider to look for them. I use Microsoft Outlook Express as my mail and news reader. To set up News on it, I click on the "Tools" menu item, then "Accounts", then the ":News" tab; next click on "Add". I then need to supply some information about my Internet Providers (IP) news server. The most important item is the server name, which, since I use NetCom, is "nntp.ix.netcom.com." Your IP will provide you with the appropriate name somewhere at their WWW site.
Once you have set up the News account, you are ready to download a list of all the newsgroups that your IP carries on their server. At present, the number that NetCom carries is well over 20,000. After this information is downloaded, you can then have the program search this list for key words in the name of a newsgroup. Subscribe to such a group and start reading the messages. Post a message of your own if you desire. But be warned that any thing you post will end up being indexed by such search sites as DejaNews (http://www.dejanews.com/ ) and be available to anyone using DejaNews to do a search. If you do a search using my last name "LaMartin", you will find about 30 "recent" messages and hundreds of "past" messages. All I hope dealing with computer questions. I have left my electronic trail. But it is nothing I am ashamed of. There are no newsgroups listed there with names like "..alt.pervert" (the kind of Internet items that give politicians and preachers something to be against). What you will see listed for me are names like microsoft.public.frontpage.client, comp.lang.basic.visual.misc, or comp.periphs.printers; not very exciting stuff by most standards but great forums for sharing information on narrowly defined topics relating to computers. I probably follow at least 20 such newsgroups off and on but only two or three at any one time, since that is about the limit of what I will be actively interested in at any one time.
So join the Usenet newsgroup crowd. As I said, there are over 20,000 such public forums to share information on almost anything you can think of: health, medicine, religion, philosophy, cars, money, sex, computing, farming, gardening, genealogy, photography, pets, mathematics ..... The list is essentially endless.
I have used the computer related groups to solve many of my problems with software (almost every program has its own newsgroup) and a few with hardware. As I have become more expert over the years, I, in turn, have been able to return the favor. It is a good feeling to be able to reply to a query with a solution and to then receive a message that your solution worked.
You can lurk, and no one will ever know you were there. You only end up being listed in newsgroup search engines like DejaNews if you post a message. But I warn you, if you lurk long enough, you are going to see a message to which you just have to respond. Then you will be electronically recorded as perhaps of the opinion that "...all politicians do it, so it is not a sin." in the "alt.politicians.clintonmustgo" newsgroup. Is there such a newsgroup? I dont know, but I do know that one could be created. All you need is a server to host it. But I have filled all the empty space, so you will have to figure out how to do that on your own. u