COM-341 HTML Publishing and Web Page Design
Final Examination Review Notes
The concept of Uploading
- A. Server Structure
- A server is just like any other computer in that it stores information in a network of directories or file folders.
- Some of these folders are available to any client who asks, and others are not as easy to access.
- In general, the two folders available to outside access are the following:
- The HTML Document folder
- This may be referred to as htdocs, or some other similar name.
- The user may never know the name of this folder, as they never have to name it. The browser, when it accesses the site, automatically is routed to that folder.
- The index.html file within the htdocs folder is the first document to be displayed automatically.
- The CGI-BIN
- This folder does have to be accessed by name, but usually not by the user.
- Again, there is some automatic routing involved, but when a particular process within an HTML document calls for a cgi script, its reference will have the exact location of the siteís cgi-bin.
- Cgi-bins contain the cgi scripts which are available to that server.
- Other folders on the server may be available to the owners of particular web sites, through FTP access or for administrative purposes.
FTP (File Transfer Protocol)
Uploading and Maintaining a Web Site
- The FTP Connection
- To connect to a server through an FTP connection requires an FTP program to manage the file transfers. These programs may resemble browsers in how they operate, but also look very much like file management programs.
- To send files from your computer to the server usually works much like copying files from one disk to another. The difference is in distance and method.
- If you are hosting a web site through a server, you must have administrative privileges on that server.
- For every site you manage, for example, you will probably need a log-in name and password to be allowed to make any alterations.
- This may not give you access to all of the files on the server, naturally, but you will have some control over those files which pertain to your site.
- Loading files
- The simple act of copying the files used by your site into the HTML directory of the server you are using is all that is necessary to make the site available for outside access.
- The HTML directory is the one which is given that numeric address which the browser looks for. Once the files are there, the server can dispatch requests for those documents to the browsers which ask for them.
- A web site can be updated by simply changing the existing HTML documents and uploading the newer versions to the server.
Newer versions of the files re-write older versions, updating the site instantly.
- It is important to understand that all files necessary to operate your site must be loaded into the serverís HTML directory.
- All graphics displayed on your pages must be available in the HTML directory, or in subdirectories which are included in all of your references.
- The only exception to this might be if your images were stored on another server somewhere else.
- Any .wav files, or other animation files must also be stored in this directory.
The Concept of CGI (Common Gateway Interface)
- CGI Scripts are instructions that allow the server to request and act on input from the user of a web site.
- It is extremely important to understand that this is one of the things that makes the Internet so incredibly valuable.
- The ability of users to send as well as receive information makes web sites truly interactive on a higher level.
- a. can you imagine "talking back" to your television set?
- It is also possible for the owners of web sites to gather very complex information about visitors to those sites
- Through the use of counters, it is possible to tabulate how many visitors had been there over a given time. It is also possible to gather information about who those visitors were, how long they stayed, what types of computers they were using, and other useful information.
- CGI scripts can perform complex actions based on user input.
- a CGI script can look up information, contact other systems and share resources, as well as display responses to inquiries.
- These are of course based on what the scripts were intended to do, and based on the programming they were provided with.
- In general, however, any function a user of a server could do could probably be programmed into a CGI script.
- CGI scripts can also update databases by adding input from web site visitors, manage user resources, and even process sales and other financial transactions.
- Limitations of CGI scripts
- CGI scripts were intended to process specific types of data and are incapable of truly understanding the input given by a user. All they can really do is react to it.
- If a user enters a date into a name field, for example, the script may not know the difference and may assume that the userís name is January 12th
- It is possible for the author of the script to anticipate such errors and build features into the script to counter them, however the script itself is only a set of instructions, and only interpret and process the data it was intended to process.
- Also, CGI scripts tend to make servers vulnerable because they are designed to access programs within the server which may not be intended for general view. The represent a possible "back door" into the server, therefore.
- Cookies are small files which can be placed on your computerís hard drive by a server for the purpose of communicating with your computer later on a subsequent visit.
- a cookie can contain evidence that you were there before, and remind the site of information which you provided earlier.
- If a web site welcomes you back by name, for example, you probably have a cookie somewhere in your system.
- A web site could also tell you when you had visited last.
- Cookies are file which can be and often are erased by your computer at regular intervals.
- You can set your browser not to accept cookies at all
- You can also determine how often your browser erases old cookies
- You should get rid of them before they get stale : )
- Cookies can be a security risk.
- Any time you allow a file to be transferred to your computer, there is a risk of harm to your system.
- It is conceivable that a computer virus could be disguised as a cookie.
- Also, you may have issues of privacy. Cookies can keep track of your movements and may report information that you might not want disclosed.
How do CGI-Scripts work?
- CGI-scripts live on the server in a special directory.
- When an HTML document accesses a CGI resource, it does so the same way it would access another web page or e-mail address, except that it calls up a .cgi file and targets a cgi directory on the server
- CGI- scripts access their own programming language in order to be able to do anything.
- A CGI script must know where on the server the CGI authoring program is.
- For example, Pearl is a program used to make CGI scripts.
- Every CGI script has the location of Pearl, or something similar, on the first line of code.
- When an HTML document accesses a CGI-script, the script responds by interpreting the input and generating some response.
- This may involve accessing other resources
- If the script involves sending an e-mail as a response, it must know where the e-mail program is on the server
- If the script involves updating a counter, it must know where the counter data is, as well as the graphics necessary to create the digits.
- The script must also know the URLs of any other documents that must be used, such as thank pages, error messages, and other things.
- Ultimately, whatever input was taken from the user will be used in determining the outcome of the script, however, the user is often directed to another web page after the scripts completion, either thanking them for their participation or informing them of some kind of error in the process.
What is DHTML?
- Simply put, Dynamic HTML is a technique by which the HTML language can be enhanced with more multimedia capabilities.
- Dynamic HTML allows for the use of scripts which work on the clientís computer rather than the server. This makes possible more complex animations with less download time and less lag.
- It also allows more user interactivity by making use of scripts which recognize what the user is doing on the screen at any given time.
- Dynamic HTML also allows for advanced multimedia tools such as streaming video and audio, as well as other embeded objects.
- DHTML is another step in the process of separating the content of a web site from its format.
- Style sheets, which are enhanced with DHTML allow the programmer to manipulate formatting information which affects the web siteís dynamic behavior without affecting the content.
- Much of the scripting which makes DHTML work is not associated with the content of the site, and is not located near it on the page.
The Dynamic Object Model
What is Object Oriented Programming?
- Object Oriented Programming allows for the treatment of certain data structures within a program as distinct elements which have standardized characteristics and can be used in specific contexts for specific purposes independent upon where they appear on the screen or in what context.
- A button is an object.
- buttons are graphic elements which are visible on the screen in a pushed or unpushed state.
- buttons respond to the user and tell the program that the user has done something.
- Buttons know what the mouse is and whether or not the pointer has passed over them or not.
- Each time a button is used in object oriented programming, it is made in a standardized way.
- It is not necessary to re-write all the code necessary for the buttonís shape, appearance, and function each time it is used.
- Although certain characteristics of buttons can be chosen and modified by the author.
- A button will still work no matter where on the screen it is placed.
- The position of the object has nothing to do with its function.
- Object oriented programming allows programmers to see their product from the userís perspective.
- Programmers can design the screen in terms of what it looks like, and then work on its functionality.
- 2. Programmers no longer have to build a program exclusively by writing endless chains of code.
Is the Internet object based?
- HTML is a text based code. As such it is not inherently object based.
- Authors of HTML have difficulty in placing graphic elements in specific places on the screen because HTML treats text and graphic elements the same
- Through the use of DHTML, more precise alignment of objects becomes possible
- Also, through DHTML, objects can be defined and can be made to respond to user input.
- DHTML objects can refer to scripts, style sheets, and other code within the web page and cause events to happen.
- Any structure in HTML can suddenly become an object.
- A link is an object, an image is an object, and anything within the <SPAN> tags can be considered an object. The tags serve as containers for stuff inside.
- Attributes within the tag identify the object by name.
- <SPAN ID="flag">Flag</SPAN>
- This object can now be called upon from elsewhere in the script by the name "flag"
- Objects can be changed by accessing and changing their atributes.
- <IMG SRC="pic1.jpg" WIDTH="10" HEIGHT="40" ID="gold">
- SRC, WIDTH, and HEIGHT are all attributes that can be changed.
- The code onclick="gold.src=ípic2.jpgí" will change the attribute of the image in such a way that the actual picture displayed will change when that object is clicked.
- Any object can become a button
- Scripts can be located within objects themselves as well.
- Scripts can be located within style sheets.
- Scripts are nothing more than sets of instructions which affect changes in how objects are displayed. They can be accessed almost anywhere.
- Some popular types of scripts are:
- VBS Script: Based on Microsoftís Visual Basic
- a. Internet Explorer is the only browser which accepts this
- Jscript is the language used by Internet Explorer. They are very similar and can be considered almost one in the same.
- Why use scripting?
- It is easy to learn
- Scripting languages follow a logic that can be mastered.
- Scripting languages are based on simple text that can be edited in any HTML editor
- Client-Side processing
- Scripting allows the local computer to make the changes through its own browser without depending on downloading more information from the server.
- Scripts can be powerful
- It is amazing what can be done with scripts and how it can enhance the visual appeal of the site.
- Scripts often call on very complex functions within the browser which do a lot of things in exchange for the addition of small simple commands into the code.
- Complexity or not
- Generally, simple scripts are most effective, but it is possible to create highly complex interactions depending on the patience and skill of the programmer.
- D. Problems with scripts
- They are not necessarily universal
- Older browsers will have no idea what you are talking about and will ignore most scripts
- b. Competitive browser manufacturers do not necessarily support each others scripting languages.
- Itís hard enough to agree on the tags themselves.
- Different computers, screen dimensions, and other factors can have unpredictable results.
- They are not always obvious
- As with HTML, capitalization, punctuation, and other rules must be closely observed.
- Scripts are new enough that there are still plenty of bugs.
- Good luck
- Scripts can be separated from the rest of the HTML by using <SCRIPT> tags
- 2. Scripts can wait for user actions before triggering their responses.
- A function is a series of commands which are defined by a script and based on some action that the user does to some object on the screen
- A button click can trigger a script, or a mouseover
- Functions wait patiently to be called on and can be called on multiple times.
Advanced Multimedia capabilities
- HTML is still just text, but it is becoming increasingly possible to extend the limits of what can be done with this language through various plug-ins available for browsers.
- A plug-in is a program which is designed to interpret specific data on an HTML document, which might be ignored completely by a browser without such a plug-in.
- JAVA scripting, and other animation formats were available through plug-ins at one time.
- As particular features become more and more popular on the Internet, various former plug-ins become standardized.
- The only exception to this would be plug-ins of a proprietary nature, which are not intended to be shared universally.
- On-line courseware, for example, may employ complex procedures and elaborate interactive graphics designed to work with software that the user must buy before accessing.
- HTML tags may be used which trigger these events, though the use of a proprietary plug-in.
Streaming Audio and Video A recent development
- Streaming media involves the use of a special way of "serving" a media file.
- Like graphics and photos, a movie file might be accessed by a document, downloaded, and displayed.
- The problem with this, however, is that movie files and sound files are very large.
- It may take several minutes or even an hour or two to download a movie file or a long sound file.
- Since the whole file would normally have to be downloaded before it is displayed, this makes movie files problematic over the Internet.
- Streaming audio and video, on the other hand, allows the user to view the file while it is in the process of downloading!
- This means that the user can see the file right away
- Ideally, the downloading process will create a "buffer" of information being downloaded, so that playback will not be interrupted.
- The use of streaming media also makes it possible to "broadcast" over the Internet!
- It is possible to stream a live signal with no predetermined length, process that signal on the userís computer, and continually update it.
- The result would be a live broadcast of a video or audio nature.
- Types of Streaming Audio/Video
- Real Audio/Video were the first major streaming media formats available, and are still pretty much the industry standard.
- Windows Internet Explorer 5, on the other hand, now offers built in support for Microsoftís own streaming video format, which utilized the Media Player took resident within Windows98.
- One major advantage here is that you donít really have to download any sort of plug-in to use it.
- It is also possible to embed the actual media player into the web page itself and use scripts to control it.
- A sound requires constant "through put" in which the computer must deliver a steady stream of information until the sound is completely played.
- Depending on the quality of the sound, the amount of information per second can be considerable.
- Sound quality is measured by two factors:
- The sampling rate (the higher the better)
- 44 Kh. Is the quality of CD music This makes the computer work hard, but it may be worth it for high quality music.
- 22 Kh is not so good, but tolerable. A reasonable compromise to free of resources, and it handles speech pretty well.
- 12 Kh is pretty bad, but audible. Likely to sound hissy.
- The format
- 16 or 32 bit refers to how big the "chunks" of sound are as they are sampled by the computer.
- The bigger the sample sizes, the better the quality.
- 16 bit is CD quality
- Donít go below 8 bit. It isnít worth it.
- Involves the use of two channels of sound which correspond to variations we might experience through the differences in the position of our ears.
- Takes up extra resources, but it may be worth it.
- However, if you didnít record in stereo, you will not get the stereo effect even if you have two tracks of audio.
- Most computer based sound is captured as sampled audio intensities, listed above. This takes up much room because the computer has no built in means of understanding it. We call these "Wave" files, or .WAV.
- However, music that is generated by computers or "synthesized" music can often come in the form of patterns of "tones" which the computer can generate. These do take up less room, but they can only be generated, not recorded, and they can only be music. These are called MIDI files.
- Internet based audio is best presented in a "streaming" format, such as a Real Media File or a Netshow file.
By far, this takes up the most computer resources of all. Video is both time based, and graphic intensive. Video images are not based on models, but on bitmaps, which are constantly being updated. As a result, the computer must continually load a steady stream of bitmap information, which is difficult to compress in any way, and simultaneously play an audio track (if the video has one) in sync with the video. This requires a great deal of resources, and only recently have computers been able to do this. Even now, video on the computer is still problematic, but it is becoming easier to do.
- How video is displayed on the compute has to do with a number of factors, which are determined in the making of the video:
- a video which attempts to cover the entire screen of a computer will probably not play very well, since it will require a massive throughput of information to update itself, though eventually this will not be a problem
- Common sizes for acceptable video are as follows:
- 640 Pixels by 480 Pixels. = full screen.
- difficult to achieve without playback problems.
- 320 by 240 = quarter screen.
- works fine on most recent computers.
- plays well on a 10X CD-ROM or faster.
- 160 by 120 = eighth of a screen.
- works well on all computers, but is hard to really see.
- 2. Useful, however, for small "cute" effects.
- Data rate:
- A video can be "compressed" by the computer to deliberately restrict the amount of data throughput allowed and reduce the image quality accordingly.
- acceptable data rates today are:
- over 600 Killobytes per second.
- Plays well from a hard drive, but may not play well from an older CD
- 300 - 600 killobytes per second.
- safe on most cds.
- Compression makes the video more "fuzzy"
- Frame rate:
- You can actually play the video back at less than 30 frames per second to increase the quality of the actual images.
- Lip sync:
- applies to how closely the computer tries to match the video flow with the audio flow.
- Aspect Ratio:
- With computer based video it is possible to "stretch" a piece of video by changing its aspect ratio.
- It is also possible, using this technique, to build computer based animations as movies, which play in shapes other than the 3 by 4 dimensions of a television screen.
- File type:
- There are a number of different types of movie files, and a wide variety of ways to compress video for playback on the computer. Some of the main file types include:
- This was designed for IBM computers, and is the standard.
- Quick Time
- This was designed for MAC computers
- a rogue standard which is impressive, but not always practical, since both the user and the author must use the same coding system before movies can be played. All IBM computers are equipped to play AVI, but few can play MPEGs.
- Internet Based video files are best converted to streaming format, which can be done using propriatary software fore either Real Media or Net Show.
On a basic level, what is a style sheet?
- Style sheets can be small sections within an HTML document affecting only the page they exist in, or they can be separate documents affecting the appearance of many whole web sites.
- Style sheets define the behavior of agreed upon HTML structures throughout the document that accesses them.
- For example, you can set a standard color for all head-line <H1> tags in your style sheet, and all occurrences of the <H1> tag will be affected.
- It is possible to "import" a separate style sheet into a given document and "share" it among many documents.
- It is also possible to import the style sheet from within another document and share that.
Why use style sheets?
- The best reason to use them is to help standardize various constructs within a particular site for the purposes of controlling the look of your documents
- The primary advantage here is the saving of key strokes.
- Writing one style tag can save having to personally adjust the attributes of fifty occurrences of a given tag.
- Also, by changing the style sheet attribute, you can change all fifty tags at once!
Basic Style Sheet Structure
- The pre-defined HTML tags
- As stated earlier, you can attach a value to any known HTML tag, such as <B>, <P>, <H6>, etc.
- The Class
- Classes are user-defined, and allow the author to create their own identification tags.
- By defining a class, it is possible for the user to tie almost any part of the document to it, by simply including the name of that class in the attributes.
- For example, defining the class .purple text as purple in color can be applied to just about any text item in a document. When this is done, the item will be redisplayed according to what the .purple text class says
- The Pseudo Class
- These are classes often defined within style sheets to solve particular problems.
- One such class was created to affect only the first letter of a paragraph.
- Also, the "hover" class tells the browser what to do with the appearance of the link when the mouse hovers over it.
- The Identity
- These constructs are used to affect only one element within an HTML document, based on a pre-determined code which only that one element uses.
- Although it is possible to use this as a class, it was originally designed to be unique.
Style Sheets and the Future
- Because style sheets are relatively new, some browsers do not yet recognize them.
- Because of this, it is strongly recommended to put everything you write into a style sheet into a comment tag <!--
- This will ensure that browsers which do not recognize the <style> tag will not display the style sheet as text.
- Style sheets which exist as separate sheets do not have any HTML constructs within them.
- Because style sheets are so useful, it is very likely that some HTML tags will shortly become depreciated in favor of them.