#!/usr/bin/perl # # ldpaddlink.cgi # requires perl5 and CGI module # # Use the CGI modules for HTML processing. # use CGI; use Carp; # Set the path for security and taint checking. # $ENV{'PATH'} = '/usr/bin:/bin'; # Create a new qry object for HTML form parsing. Get variables. # local($qry) = new CGI; local($email) = $qry->param('email') || ''; local($url) = $qry->param('url') || ''; local($ttl) = $qry->param('ttl') || ''; local($desc) = $qry->param('desc') || ''; local($ff) = $qry->param('ff') || ''; local(@ltype) = $qry->param('ltype'); local($ref_url) = $qry->referer() || 'http://tldp.org/links/index.html'; print $qry->header(); print "\n
\n",
"LDP: Add a Link
\n";
# spam block
#
if( $ff ne '666' || $email =~ /link\-builder/i ) {
print "ok
Warning: Required field(s) are missing
\n"; } else { open(FP, "| /usr/lib/sendmail -oi -t") || do { print "ERROR: cannot open link database. Contact ", "webmaster
\n", "