Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
if ( $pid = fork() ) { ########## # Sets up the Unix and Oracle variables for the system ########## $ENV{ORACLE_HOME} = '/home/oracldwh/app/oracle/product/7.3.2'; $ENV{LD_LIBRARY_PATH} = '/home/oracldwh/app/oracle/product/7.3.2/l +ib'; # Database connection variables my $database = "**********"; my $username = "**********"; my $password = "**********"; my $html; ########## # Create initial portion of page with title and heading ########## $html .= header( -Refresh=> '0'; 'manager_selection_fork.cgi'); $html .= $query->start_html(-'title'=>'Asset Insight Manager Resou +rces', -BGCOLOR=>'#00CCFF'); ########## # Created the form portion ########## $html .= "<center>"; $html .= $query->startform({-method=>'post', -action=>'http://www3 +.syr.lmco.com/cgi-bin/asset/employee_list.cgi', -target=>'bottom'}); ########## # Connects to the database and runs the specified query ########## my $dbh = DBI->connect($database, $username, $password, 'Oracle') or die "can't connect to $database: $DBI::errstr"; my $sth = $dbh->prepare( q{ SELECT DISTINCT e1.emp_badge, e1.emp_name_last, e1.emp_nam +e_first, e1.emp_job_ttl FROM emp e1, emp e2 WHERE e1.emp_ssn = e2.mgr_ssn AND e1.emp_badge is not NULL ORDER by e1.emp_name_last }) or die "Can't prepare statement: $DBI::errstr"; my $rc = $sth->execute() or die "Can't execute statement: $DBI::errstr"; my @the_values; my %labels; ########## # Concatnates each returned row and pushes them into an array ########## while (my ($emp_badge, $emp_name_last, $emp_name_first, $emp_job_ +ttl) = $sth->fetchrow()) { $labels{"$emp_badge"} = join(' -- ', $emp_name_last, $emp_ +name_first, $emp_job_ttl); push(@the_values,$emp_badge); } ########## # Creates the dropdown box with the apropriate names and associati +ons ########## $html .= $query->popup_menu(-name=>'mgr_badge',-'values'=>\@the_va +lues,-labels=>\%labels); $html .= $query->submit(-value=>'Submit Selection'); $html .= "</center>"; $html .= end_html; ########## # Prints out the entire HTML Page as it was created above ########## print $html; # check for issue we may have had durring this little excursion warn $DBI::errstr if $DBI::err; ########## # This Ends the statement handle and closes the connection to the +database ########## $sth->finish; $dbh->disconnect; } ########## # The Child portion of the Fork ########## elsif ( defined( $pid ) ) { my $html2; $html2 .= header; $html2 .= $query->start_html(-'title'=>'Loading', -BGCOLOR=>'#00CCFF'); $html2 .= "<CENTER>"; $html2 .= "<!-- URL's used in the movie-->"; $html2 .= "<!-- text used in the movie-->"; $html2 .= "<!--L o a d i n g . --><OBJECT classid=\"clsid:D27CDB6E +-AE6D-11cf-96B8-444553540000\""; $html2 .= " codebase=\"http://download.macromedia.com/pub/shockwav +e/cabs/flash/swflash.cab#version=5,0,0,0\""; $html2 .= "WIDTH=250 HEIGHT=50>"; $html2 .= "<PARAM NAME=movie VALUE=\"http://www3.syr.lmco.com/ass +et/Loading.swf\"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor + VALUE=#FFFFFF> <EMBED src=\"Loading.swf\" quality=high bgcolor=#FFFF +FF WIDTH=250 HEIGHT=50 TYPE=\"application/x-shockwave-flash\" PLUGIN +SPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Pro +d_Version=ShockwaveFlash\"></EMBED>"; $html2 .= "</OBJECT>"; $html2 .= "</CENTER>"; $html2 .= end_html; print $html2; print "<br>\n"; #$END = time(); exit(); } #$END = time(); else { die( "Could not Fork" ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Forking 2 html Pages
by merlyn (Sage) on Sep 18, 2001 at 19:00 UTC | |
|
Re: Forking 2 html Pages
by Cine (Friar) on Sep 18, 2001 at 18:03 UTC | |
|
Re: Forking 2 html Pages
by Rhandom (Curate) on Sep 18, 2001 at 19:25 UTC |