#!/usr/bin/perl # # If there is a registration cookie on this computer then redirect to # the document location, otherwise present the registration form # The registration form then can redirect to the document if registration # succeeds. require './cgi-lib.pl'; use CGI; $query = new CGI; &ReadParse(*form_data); $docURL = $form_data{'doc'}; $registrationURL = "processRegistration.pl" . "?doc=" . $docURL; #----------------------------------------------------------------------# # Retrieve the cookie. Do this by using the cookie method without # # the -value parameter. # #----------------------------------------------------------------------# $theCookie = $query->cookie('farco_form_complete_2008'); if ("$theCookie") { print "Location: $docURL\n\n"; } else { print "Location: $registrationURL\n\n"; }