#!/usr/bin/perl use CGI qw(:standard); #name used to identify cookie $cookiename = "klink_info"; #username tab password, stored in cookie, checked on every screen $logininfo = "username\tpassword"; #rawfile generated $datafile = "/home/myuser/public_html/bookmarks/bookmarks"; #static HTML file used to display bookmarks after every transaction $outfile = "/home/myuser/public_html/bookmarks/bookmarks.html"; #static HTML file that just has bookmarks in "blank" category #(this category sorts first on the big list, and is useful for #"hot" bookmarks) $outhotfile = "/home/myuser/public_html/home/hotlinks.html"; #Location and name of this script $mainurl = "http://www.sitename.com/bookmarks/klink.cgi"; #Location and name of the output file $outurl = "http://www.sitename.com/bookmarks/bookmarks.html"; $userinfo = cookie($cookiename); $screen = param("screen"); $dologin = param("dologin"); if($dologin eq "on" || $dologin eq "off") { if($dologin eq "on") { $userinfo = param("username")."\t".param("password"); } else { $userinfo = ""; } $packed_cookie = cookie( -NAME => $cookiename, -VALUE => $userinfo, -EXPIRES => "+2y" ); print header(-COOKIE => $packed_cookie); } else { print header(); } print getTop(); if($userinfo eq $logininfo) { if($screen eq "formadd" || $screen eq "formedit") { if($screen eq "formadd") { getUsedcat(); $titler = "Add New"; $targeter = "doadd"; }else { getUsedcat(param("id")); $titler = "Edit"; $targeter = "doedit"; } print<<__EOQ__;