#!/usr/planet/bin/perl5 require("include/bbn.pm"); use Msql; #### configuration constants $SENDMAIL = '/usr/lib/sendmail'; # location of your sendmail binary $TO_ADDRESS = 'sourceNEW@mail.cato.com'; # will become this one #### Do standard HTTP stuff #### &cgi_receive; &cgi_decode; &cgi_header; #### Do the actual processing ########################################## #### Make sure the database is alive $dbh = Connect Msql; if (!$dbh) { &do_msql_error; } SelectDB $dbh $DB; #### mash some fields to all lower case $FORM{'email'} = "\L$FORM{'email'}" ; #$FORM{'password'} = "\L$FORM{'password'}" ; #$FORM{'password2'} = "\L$FORM{'password2'}" ; #### Validate the data... are the fields filled in? &check_fields; #&do_pwd_doc; &zorch_nasties; #&check_pwd; &check_logon; #### Add the data to the database $dmade= time(); $query = "insert into $TBL_REG values ('$FORM{'email'}', 'NoMorePwds', '$FORM{'lname'}', '$FORM{'fname'}', '$FORM{'company'}', '$FORM{'title'}', '$FORM{'address'}', '$FORM{'country'}', '$FORM{'phone'}', '$FORM{'fax'}', '$FORM{'howheard'}', $dmade, '$ENV{'REMOTE_ADDR'}', '$ENV{'REMOTE_HOST'}', '$ENV{'REMOTE_USER'}', 'N',$dmade)"; $sth = Query $dbh $query; if (!defined($sth)) { print "We were unable to add your information to the CatoSource database."; print "
\n"; print "Please try registering again in a few minutes, or contact "; print "CatoSource to report the problem using the email address below."; print "
\n"; &cgi_footer; exit; } #### snapshot the database for backup $DBDUMPFILE = $DBDUMP_PATH . $DB . ".dump." . $dmade ; `$DBDUMPER $DB >$DBDUMPFILE` ; #### confirm data with the user &do_thanks_doc; #### Notify someone at CCS &do_mail; exit; #### SUBROUTINES #################################################### sub error_blank_field { # Procedure to send a message back to the user if a required field on # the form was left blank. Call with the name of the missing field. local($variable) = @_; print "