itis 1210 introduction to web-based information systems chapter 24 how websites work with databases...
TRANSCRIPT
ITIS 1210ITIS 1210Introduction to Web-Based Introduction to Web-Based
Information SystemsInformation Systems
Chapter 24Chapter 24
How Websites Work with DatabasesHow Websites Work with Databases
DatabasesDatabases
Enables Web sites to search for Enables Web sites to search for informationinformation Not part of the “visible” Web!Not part of the “visible” Web!
Web site becomes “front end” for a Web site becomes “front end” for a database applicationdatabase application
Usually involves entering search terms Usually involves entering search terms and viewing resultsand viewing results
DatabasesDatabases
Example: Example: www.yahoo.com Yahoo’s Web page includesYahoo’s Web page includes
Search dialog boxSearch dialog box Enter keywordEnter keyword
Search buttonSearch button Enable searchEnable search
What is returned is an HTML-formatted page What is returned is an HTML-formatted page with data from Yahoo’s database relevant to with data from Yahoo’s database relevant to the keywordthe keyword
DatabasesDatabases
Interaction can be two-wayInteraction can be two-way Users asked to “register”Users asked to “register” Provide identifying informationProvide identifying information Site stores this in their databaseSite stores this in their database
For future referenceFor future reference For data collectionFor data collection
DatabasesDatabases
Database can be simple or complexDatabase can be simple or complex Excel spreadsheetExcel spreadsheet Access databaseAccess database Oracle SQL databaseOracle SQL database
CGI – Common Gateway InterfaceCGI – Common Gateway Interface Bridges Web site (using HTML) and Bridges Web site (using HTML) and Database (using Excel, Access, SQL, etc.)Database (using Excel, Access, SQL, etc.)
PERL & .NET also provide bridgesPERL & .NET also provide bridges
How the Web Works with DatabasesHow the Web Works with Databases
http://search.yahoo.com/cgi-bin/search?p=public+relations&ln=En
ServerServer Folder where CGI executables are storedFolder where CGI executables are stored
““bin” is short for “binary” meaning a program bin” is short for “binary” meaning a program that can be executedthat can be executed
Name of CGI script to be runName of CGI script to be run Parameters to control what script doesParameters to control what script does Space (+)Space (+) Delimiter between different terms of stringDelimiter between different terms of string
How the Web Works with DatabasesHow the Web Works with Databases
How the Web Works with DatabasesHow the Web Works with Databases
User enters search term in form on User enters search term in form on browserbrowser
Initiates searchInitiates search Presses WEB SEARCHPresses WEB SEARCH Presses ENTERPresses ENTER
Client formats a Client formats a query stringquery string and sends it and sends it to Web serverto Web server
The “search?” part calls a CGI scriptThe “search?” part calls a CGI script
How the Web Works with DatabasesHow the Web Works with Databases
The rest are The rest are parametersparameters that control what that control what happenshappens
Might see Might see /cgi-bin/cgi-bin to indicate directory to indicate directory where executable can be foundwhere executable can be found
DelimitersDelimiters & separates search terms and other & separates search terms and other
parametersparameters + takes place of space+ takes place of space
Query string arrives at the Web serverQuery string arrives at the Web server
How the Web Works with DatabasesHow the Web Works with Databases
CGI processes isCGI processes is Sends query to databaseSends query to database
Database processes query and returns Database processes query and returns results to CGIresults to CGI
CGI returns results to the Web serverCGI returns results to the Web server Web server creates a new HTML page Web server creates a new HTML page
and sends it back to the clientand sends it back to the client Client displays resultsClient displays results