#!/usr/bin/perl # # Generates a navigation bar suitable for display across the top or bottom of a page. # use CGI qw(:standard); use Pg; $dbmain='ldp'; @row; $query = new CGI; # connect to the database $conn=Pg::connectdb("dbname=$dbmain"); $username = $query->remote_user(); $result=$conn->exec("SELECT username, admin, first_name, surname FROM username WHERE username='$username'"); @row = $result->fetchrow; $admin = $row[1]; $firstname = $row[2]; $surname = $row[3]; print "\n"; print "\n"; print "\n"; print "\n "; print "\n "; print "\n "; print "\n "; if ($admin) { print "\n "; } print "\n "; print "\n "; print "\n"; print "\n";