#!/usr/bin/perl ### # use strict; use CGI::Carp qw(fatalsToBrowser) ; ### # required files - use lib "/home/sites/lai" ; use common::lai_Cookies ; use common::lai_Dates ; use common::lai_General ; use www::lai_www_Config ; use www::lai_www_Wrapper ; ### # get arguments sent by the link - This subroutine (&lai_General::get_params) gets the # arguments from any queries. # # Output: $params{'date'} - data requested for viewing my ($params) = &lai_General::get_params ; my %params = %$params ; ### # get script information - This subroutine (&lai_General::script_info) sends back # the information needed to be able to know what we are # going to provide. # # Input: none # # Output: $urlPath - where the script is located in respect to the URL # Output: $resourceName - name of the resource being used. # Output: $directoryName - name of the directory where the script resides. # Output: $scriptName - name of script currently running. my ($urlPath, $scriptName) = &lai_General::script_info($params{'info'}) ; ### # get cookie information - This subroutine (Cookies::get_cookieData('login') ; # my ($list_number, $name_first, $name_last, $list_type) = split(/\,/, &lai_Cookies::get_cookieData('login'), 4) ; ### # print Content type print qq~Content-type: text/html\n\n~ ; ### # open up the database stream - a data stream used to get information from the MySQL # database server. This is closed at the end of the # script. The $dbh is used throughout to reference the # stream for queries. # # Input: $ipAddress - address of the MySQL server my $ipAddress = qq~localhost~ ; # Input: $tableName - name of table to be acessed my $tableName = qq~lai~ ; # Input: $dbUser - username to access the database my $dbUser = qq~study~ ; # Input: $dbPassword - password to access the database my $dbPassword = qq~dziekuje~ ; # # Output: $dbh - handle of opened data stream my $dbh = &lai_General::open_dataStream($ipAddress, $tableName, $dbUser, $dbPassword) ; ### # get resource information # # Input: $resourceLocation - urlPath + scriptName my $resourceLocation = $urlPath . "/" . $scriptName ; # Input: $dbh - self explanatory my $resourceData = &lai_General::get_metaData($resourceLocation, $dbh) ; my @resourceData = @$resourceData ; ### # write header - This subroutine (&lai_www_Wrapper::Header) creates the top # half of the c-wrapper. Very straight-forward in how # it does it. NOTE: To send additional JavaScript, # use the $extraStuff variable. # Input: $metaInfo - taken from the script_info subroutine my $metaInfo = join "\t", @resourceData ; # Input: $dbh - received from opening database stream # Input: \*STDOUT - STDOUT shows that this is going to the display # Input: $leftColumn - Info used to build the left column my $leftColumn = qq~|~ ; # Input: $extraStuff - first part would be for the "onLoad" argument # additional JavaScript that needs to be executed my $extraStuff = qq~/~ ; # Input: $rssfeed - tells if there is a feed on this page my $rssfeed = qq~~ ; # Input: $keywords - sends the keywords searched on to the ad management software my $keywords = qq~~ ; # Input: $list_number - is user logged in? &lai_www_Wrapper::Header($metaInfo, $dbh, \*STDOUT, $leftColumn, $extraStuff, $rssfeed, $keywords, $list_number) ; ### # close database stream - This subroutine (&lai_General::close_dataStream) takes the # handle, $dbh, created in the initial opening of the # stream and now simply closes it. # # Input: $dbh - received from opening database stream &lai_General::close_dataStream($dbh) ;
Rights and Permissions
All materials contained on LiveAsIf.org are protected by copyright in the U.S. and other countries. This page contains information on how to request permission to reuse content from LiveAsIf.org for your own purposes. Articles credited to a source other than LiveAsIf.org are owned by that source. Please contact them directly for permission to reuse their material.
Permissions
To request permission to photocopy or reprint our materials, please submit your request by e-mail.
Please include the following information along with your request:
Trademarks
The LiveAsIf.org name and logo used on this site are trademarks owned by StudyLight.org. All other trademarks are the property of their respective owners.
Linking to the site
LiveAsIf.org invites you to place a link to our site on your personal or organizational Website. Permission is not needed to link to us. However, we ask that you do not place our site in a frame since this can give a false impression. Please see the 'link to' page for more information about linking to our homepage, search engine or to individual articles.