Wayne State University
College of Lifelong Learning
Interdisciplinary Studies Program, Fall, 1999
http://www.cll.wayne.edu/isp/drbowen/internet
Instructor email: d.r.bowen@wayne.edu
Instructor tel (WSU) (313) 577-1498 / (Home) (248) 549-8518
eCommerce: Using the Web to Find and Service Customers
AGS 3360 Section 986 Call Number 99882
or ISP 5500 Section 982 Call Number 90569

Last updated: 10/27/99
Link back to course Welcome

iHTML #2
for AGS 3360: eCommerce

  1. When the SUBMIT button is clicked, here is what happens, in order
    1. Browser sends all content in form fields between <form ...> and </form> containing the button, to the web server
    2. The web server looks for the Gateway program, starts it and passes it the form information, and tells it where to leave its response
    3. The Gateway program
      1. Processes the information (what this means is up to the program developer)
      2. Prepares a response HTML page for the user
      3. Ends
    4. When the web server notices that the Gateway program has ended, it sends the program's response page back to the user
  2. iHTML
    1. .iht extension, named as the action, causes the iHTML preprocessor to process the file before the web server sends it to the user
    2. Notepad or Wordpad to insert iHTML tags
    3. Can still use FrontPage to prepare standard HTML parts, for example by Copy and Paste
      1. In order to get the HTML tags into Notepad or Wordpad, must copy from FrontPage in the HTML view
    4. An iHTML file (.iht extension) is a mixture of normal ASCII text, standard HTML tags, and special iHTML tags
      1. The file is "preprocessed" by iHTML before being sent to the user as the system response
      2. Text and HTML tags get passed through to user without change
      3. What happens to iHTML tags
        1. Some cause an action such as sending an email or saving information from the form to a database
        2. Some get replaced with information, such as information from a database or from the form
        3. None get passed through to the user (unless they are replaced)
  3. iHTML tags -- all start with i
    1. <!ihtml> as the first line - alerts iHTML to process the file
    2. :fieldname from HTML form replaced with the value of fieldname, e.g.
      • html form file <input type=text name="FirstName">
      • user types in "John"
      • in .iht file, :FirstName replaced with John
      • Appears as regular text, sent by web server back to browser, displayed by browser
    3. iIP - numerical IP address of the user's computer
    4. iTIME - the current time
    5. iDATE - the current date
    6. Inserting information into a database. Third column is comment only - do not include in tag.
      <iHTML dbname="DataSourceName" Use Team DSN
      sql="insert into tablename (list of fieldnames) Separate field names with commas
      values ('value1', 'value2', 'value3' ... 'lastvalue')" Values can also be colon variables from form
      FAILURE="Error: :i_error :i_errortext :i_sqlerrortext<br>"> Displays an error message if tag fails. Useful for debugging, but you don't want your users seeing this!
    7. Getting information out of a database. Third column is comment only - do not include in tag.
      <iSQL dbname="DataSourceName" Use Team DSN
      sql="select * from tablename * = all fields
      where fieldname='value' "where" is optional
      FAILURE="Error: :i_error :i_errortext :i_sqlerrortext<br>"> Displays an error message if tag fails. Useful for debugging, but you don't want your users seeing this!
      <iSQLFETCH>
      <iWHILE NOTALIAS=i_sqlempty>

      use the data - print, add whatever

      <iSQLFETCH>
      </iWHILE ALIAS=i_sqlempty>
      </SQL>
    8. Updating information in a database. Third column is comment only - do not include in tag.
      <iSQL dbname="DataSourceName" Use Team DSN
      sql="update tablename set fieldname='value' value of fieldname in tablename will be changed to value
      where fieldname2=value2 (optional) only for fields where fieldname2 = value2
      FAILURE="Error: :i_error :i_errortext :i_sqlerrortext<br>"> Displays an error message if tag fails. Useful for debugging, but you don't want your users seeing this!
    9. Evaluate a mathematical expression
      <iEVAL EXPR="some mathematical expression">
      Example:
      <iEVAL EXPR=":total + :number * :price">
    10. Create a new variable (say, total amount of order)
      <iEQ NAME="variablename" VALUE="value">
      Example 1:
      <iEQ NAME="total" VALUE="0">
      Example 2:
      <iEQ NAME="total" VALUE="<iEVAL EXPR=":total + :number * :price">>