#!/usr/bin/perl use DBI; use CGI; use Image::Size; sub env() { $query = $ENV{'QUERY_STRING'}; $cookie = $ENV{'HTTP_COOKIE'}; ($cookiename,$cookievalues) = split(/=/,$cookie); ($cookietype,$cookieuser) = split(/\&/,$cookievalues); $imgpath = "/home/e-smith/files/ibays/Primary/html/departments"; $imgpathweb = "/departments"; } sub form_read() { $q = new CGI; %fr = (); foreach ($q->param()) { $fr{$_} = $q->param($_); } } sub mysql_connect() { $dbh = DBI->connect("dbi:mysql:departments","user","passwd") or die "SQL Connection Error."; } #### #!/usr/bin/perl require '../global/global.pl'; &env(); &mysql_connect(); $sth = $dbh->prepare("select label,notes from departments where department='$query'"); $sth->execute; ($departmentlabel,$departmentnotes) = $sth->fetchrow_array; $sth->finish; $dbh->disconnect; &form_read(); print $fr{aformfield};