Previous Section Table of Contents Next Section

The Basic Web Page

I always start by using FrontPage or a similar Web page layout tool to design the page's look and feel, before I add any script. Now, I'm no Web page designer, so my Web pages aren't usually super attractive, but they get the job done. Administrative scripts usually don't have to be as pretty as they do functional!

For this example, I know I'm going to need to start with some kind of HTML input form that will allow the user to specify a computer, an event log, an event ID, and other criteria. That type of form is easy enough to create in FrontPage, and here's the HTML code.


<FORM ACTION="event.asp" METHOD="POST">

 <Table cellpadding=2 cellspacing=2 border=0>

  <TR>

   <TD>

    <INPUT type="text" name="ComputerName"

     value="">

   </TD>

   <TD>Computer:</TD>

  </TR>

  <TR>

   <TD>

    <SELECT name="LogName">

     <OPTION value="application">Application</OPTION>

     <OPTION value="system">System</OPTION>

     <OPTION value="security">Security</OPTION>

     </SELECT>

    </TD>

    <TD>Log</TD>

   </TR>

   <TR>

    <TD><INPUT type="text" name="Source"></TD>

    <TD>Event Source</TD>

   </TR>

   <TR>

    <TD>

     <SELECT name="Type">

      <OPTION value="">All</option>

      <OPTION value="information">Information</OPTION>

      <OPTION value="warning">Warning</OPTION>

      <OPTION value="error">Error</OPTION>

     </SELECT>

    </TD>

    <TD>Type</TD>

   </TR>

  <TR>

   <TD><input type="text" name="EventCode"></TD>

   <TD>Event Code</TD>

  </TR>

  <TR>

   <TD><input type="text" name="UserName"</TD>

   <TD>User Name</TD>

  </TR>

  <TR>

   <TD><input type="password" name="Password"></TD>

   <TD>Password</TD>

  </TR>

  <TR>

   <TD COLSPAN=2 Align=center>

    <INPUT type="submit" NAME="Submit" VALUE="Submit">

   </TD>

  </TR>

 </TABLE>

</FORM>

NOTE

Don't worry about typing these in. At the end of this chapter, I'll give you the entire script all at once (and there's a copy on the accompanying CD). Right now, just focus on what each of these different elements accomplishes.


That's a basic HTML form with several input fields. Notice that I used some drop-down lists-designated by the SELECT and OPTION tags-for things like the event log and the event type.

I also know that I'm going to need to display the final event log information in a table. It'll help at this point to just sort of mock up what that table will look like in HTML.


<TABLE cellspacing=0 cellpadding=3 border=1>

 <TR>

  <TH>Record</TH>

  <TH>Type</TH>

  <TH>Date</TH>

  <TH>Time</TH>

  <TH>Source</TH>

  <TH>Category</TH>

  <TH>Cat Strg</TH>

  <TH>Event</TH>

  <TH>Usr</TH>

  <TH>Computer</TH>

  <TH>Msg</TH>

 </TR>

</TABLE>

That HTML represents the first row of the table. Subsequent rows would contain actual data, and I'd use <TD> tags instead of the <TH> tags. I actually plan to have my code dynamically produce this HTML on-the-fly, so that I can produce as many data rows as necessary, but it helps to get the HTML figured out up front.

That's it! It's not going to win any design awards, but the basic HTML for the event log page is out of the way.

    Previous Section Table of Contents Next Section