jdgamble wrote:
It obviously depends on the script you are creating! I use something like this when I create a new script:
Code:
#!/usr/bin/perl
#================================
use strict;
use lib 'your admin path';
use Links qw/:objects/; # or whatever $IN, $DB, $CFG, $USER etc...
use Links::SiteHTML; # if your using templates
use GT::Mail; # if your sending mail...
Links::init('your admin path');
Links::init_user(); # gets the user information
local $SIG{__DIE__} = \&Links::fatal;
main();
sub main {
#---------------------------------------------------
#
my $do = $IN->param('do'); # gets input
# check to see if your logged in
if (!$USER) {
print $IN->redirect('$CFG->{db_cgi_url}/user.cgi?url=path to this filename');
}
# the rest of your script...
}
Hope this helps,