1 / 33

HTML Interfacing with Databases

HTML Interfacing with Databases. By Jason Chin. What is covered in this Presentation?. Use of Form tags (HTML) to interface with databases. Introduction to CGI Introduction to Java Servlets Real-Life Examples. How Browsers Communicate with Web servers?.

warner
Download Presentation

HTML Interfacing with Databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HTML Interfacing with Databases By Jason Chin

  2. What is covered in this Presentation? • Use of Form tags (HTML) to interface with databases. • Introduction to CGI • Introduction to Java Servlets • Real-Life Examples

  3. How Browsers Communicate withWeb servers? • When a Web browser looks up a URL the following happens. • First your computer contacts the HTTP server with the URL. The HTTP server looks at the filename requested by your computer. • The HTTP Server will then sends that file back. • Your computer then displays the file in the appropriate format.

  4. How to “TALK” to databases with HTML? • Use of Forms Tags (Part of HTML)

  5. Form Tags • Used to create HTML forms to solicit user feedback. • Add interactivity to Web pages. • Form tags provide a variety of graphical and text items, as well as pick lists, that allow users to choose from different input options.

  6. <BUTTON> ... </BUTTON> • Use BUTTON tags to create graphically interesting form input controls that provide more variety than standard submit and reset buttons. • Of course, images can be used instead.

  7. Attributes of<BUTTON> ... </BUTTON> 1. DISABLED - Disables the button. 2. NAME="name“ - Defines a name for the button. 3. TABINDEX="number“ - Specifies the element's place in the tabbing order. 4. TYPE=BUTTON|SUBMIT|RESET - Defines the type of button. (See Table 18.) 5. VALUE="value“ - Defines the button's value.

  8. <FORM> ... </FORM> • Use FORM tags to create the region on a page that holds the elements for soliciting user input.

  9. Attributes of<FORM> ... </FORM> 1. ACTION="URL“ - Specifies the location of a resource for the browser to execute once a form has been completed and submitted. 2. METHOD=("GET"|"POST") - This attribute lets the browser know how it should work with the resource identified by the ACTION attribute.

  10. Attributes of<FORM> ... </FORM> (cont’d) 4. TARGET="window“ -Specifies that the link should be loaded into the targeted frame or window. Use this attribute when the targeted frame or window is different from the frame or window the current document resides in. The attribute can target a <FRAMESET> where a frame has been created and given a name using the <FRAME> element or an entire browser window.

  11. <INPUT> • The INPUT tag defines type and appearance for input widgets.

  12. Attributes of<INPUT> 1. ALIGN=(LEFT|CENTER|RIGHT) - Specifies how the widget will be aligned relative to the page. 2. CHECKED - Specifies that a checkbox or radio button should appear selected when the form is displayed by the browser. 3. DISABLED - Disables the input control.  

  13. Attributes of<INPUT> (cont’d) 4. NAME="text" - Names the input widget. 5. MAXLENGTH=number - Sets the maximum number of characters a user can enter into a text field.   6. READONLY - Prevents the user from altering the widget's contents.

  14. Attributes of<INPUT> (cont’d) 7. SIZE="width|(width, height)" - Sets the width and height of a text input widget.   8. SRC="URL" - When TYPE=IMAGE is used, this attribute specifies the URL for the image.   - TYPE= (TEXT|PASSWORD|CHECKBOX|RADIO|SUBMIT| RESET|FILE|HIDDEN|IMAGE|BUTTON)

  15. Attributes of<INPUT> (cont’d) 9. VALUE=value - For nontext field input elements, this attribute specifies the value that should be returned to the server when the form is submitted.

  16. <OPTION> • The OPTION tag assigns a value or default to an input item in a select menu.

  17. Attributes of<OPTION> 1. DISABLED - Disables the input control.   2. SELECTED - Indicates that the option should be the default choice that appears in the menu window. 3. VALUE="text" - Sets the value for the individual option.

  18. <SELECT> ... </SELECT> • The SELECT tags create a menu or scrolling list of input items.

  19. Attributes of<SELECT> ... </SELECT> 1. DISABLED - Disables the input control. 2. MULTIPLE - Allows users to choose more than one item from the set of <OPTION> values supplied within the <SELECT> ... </SELECT> tag pair. 3. NAME="text" - Associates a name with the list.

  20. Attributes of<SELECT> ... </SELECT> (cont’d) 4. SIZE="number" - Sets the number of choices visible within the drop-down menu. 5. TABINDEX="number" - Specifies the control's place in the tabbing order.

  21. Limitations • Incomplete specification of Tag Features • Incomplete tags • Recommend to get books for more details • Tags covered are general and important ones

  22. HTML Tips • All filenames after the domain is case-sensitive. • Its recommended to use short and small caps filenames. • Download and run your own web server program so that you can test the page with a web server.

  23. Introduction to CGI Common Gateway Interface

  24. What is CGI? • CGI is the Common Gateway Interface which allows you to create Web pages on the fly based on information from buttons, checkboxes, text input and so on. The pages can be images, sounds, text and indeed everything else transferable by the Web. They can even be references to other Web pages

  25. How Browsers Communicate withWeb servers? • When a Web browser looks up a URL the following happens. • First your computer contacts the HTTP server with the URL. The HTTP server looks at the filename requested by your computer. • The HTTP Server will then sends that file back. • Your computer then displays the file in the appropriate format.

  26. How CGI Works? • The HTTP server is set up in such a way that whenever a file in a certain directory is requested that file is not sent back; instead it is executed as a program. • The program outputs is sent back for your computer to display. • This function is called the Common Gateway Interface or CGI. The programs are called CGI scripts.

  27. How can CGI Work with Databases? • Use of Perl Databases & Language. • Any other ways?

  28. Inconvenience of CGI • The directory that the CGI scripts sit in cannot be specified by you alone • You need the help of whoever runs your HTTP server.

  29. Introduction to Java Servlets JAVATM SERVLET API

  30. What are Servlets? • Servlets are the Java platform technology of choice for extending and enhancing Web servers. • Servlets provide a component-based, platform-independent method for building web-based applications, without the performance limitations of CGI programs.

  31. Advantages of Servlets • Unlike proprietary server extension mechanisms (such as the Netscape Server API or Apache modules), Servlets are server- and platform-independent. This leaves you free to select a "best of breed" strategy for your servers, platforms, and tools.

  32. Java Servlets with Databases • Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases. • Servlets also access library of HTTP-specific calls, and all the benefits of the mature Java language, including portability, performance, reusability, and crash protection.

  33. Sources HTML Reference http://www.htmlreference.com/ The Ultimate Perl Learning Experience http://library.thinkquest.org/16435/ Information About CGI http://agora.leeds.ac.uk/nik/Cgi/start.html Information About Java Servlets http://java.sun.com/products/servlet/index.html WebRover http://www.krdl.org.sg/Research/CurProj/rover/rover.html

More Related