#!/usr/bin/perl -w use CGI::Carp 'fatalsToBrowser'; use strict; use warnings; my $adv = "Advertise your script here!"; # Simple text ad for this sc +ript my $sendmail = "/usr/lib/sendmail"; my $scriptname = "Meta Tag Generator"; # Name you want to call this + script my $scriptlocation = "http://www.where.com/tags.pl"; # Link send to th +eir email addy use CGI qw/:standard/; print header, start_html('Meta Tag Generator'); print start_form(), table( Tr(td( "Email Address: "), td(textfield(-name=>'usermail', -size=>40)) ), Tr(td("Author: "), td(textfield(-name=>'author', -size=>40)) ), Tr(td("Distributor: "), td(textfield(-name=>'distributor +', -size=>40)) ), Tr(td("Copyright: "), td(textfield(-name=>'copyright', -size=>40)) ), Tr(td("Abstract: "), td(textfield(-name=>'abstract', -size=>40)) ), Tr(td("Keywords: "), td(textarea(-name=>'keywords', -rows=>5, -columns=>30)) ), Tr(td("Description: "), td(textarea(-name=>'description' +, -rows=>5, -columns=>30)) ), Tr(td("Robots: "), td(popup_menu(-name=>'robots', -values=>['','index','noindex','follow','nofollow'])) ) +, Tr(td("Distribution: "), td(popup_menu(-name=>'distributi +on', -values=>['','local','global'])) ), Tr(td("Language: "), td(popup_menu(-name=>'language', -values=>['','EN','EN-GB','EN-US','ES','ES-ES','FR','IT +','JA','KO','DE'])) ), Tr(td("Rating: "), td(popup_menu(-name=>'rating', -values=>['','kids','general','mature','restricted'])) +), Tr(td(), td(checkbox(-name=>'emailme', -checked=>1, -value=>'ON', -label=>'Email my tags!')) ), Tr(td(), td(submit) ), ), end_form(), hr(); my $abstract = param('abstract'); my $usermail = param('usermail'); my $author = param('author'); my $distributor = param('distributor'); my $keywords = param('keywords'); my $description = param('description'); my $distribution = param('distribution'); my $robots = param('robots'); my $rating = param('rating'); my $language = param('language'); my $copyright = param('copyright'); my $emailme = param('emailme'); my $tags =''; if (param('abstract') ne "") { $tags .= qq(&lt;meta name="abstract" content="$abstract"&gt;<br>) +; } if (param('author') ne "") { $tags .= qq(&lt;meta name="author" content="$author"&gt;<br>); } if (param('distributor') ne "") { $tags .= qq(&lt;meta name="distributor" content="$distributor"&gt +;<br>); } if (param('copyright') ne "") { $tags .= qq(&lt;meta name="copyright" content="$copyright"&gt;<br +>); } if (param('keywords') ne "") { $tags .= qq(&lt;meta name="keywords" content="$keywords"&gt;<br>) +; } if (param('description') ne "") { $tags .= qq(&lt;meta name="description" content="$description"&gt +;<br>); } $tags .= qq(&lt;meta name="generator" content="$adv"&gt;<br>); if (param('robots') ne "") { $tags .= qq(&lt;meta name="robots" content="$robots"&gt;<br>); } if (param('language') ne "") { $tags .= qq(&lt;meta name="language" content="$language"&gt;<br>) +; } if (param('distribution') ne "") { $tags .= qq(&lt;meta name="distribution" content="$distribution"& +gt;<br>); } if (param('rating') ne "") { $tags .= qq(&lt;meta name="rating" content="$rating"&gt;<br>); } if (param()) { print "<b>Instructions:</b> To install your brand new meta tags copy a +nd paste your code below between the \<HEAD\> and \</HEAD\> tags of y +our website!<br><br>"; print $tags; print hr; print end_html(); ### Sent their tags via email if ($emailme ne "") { $tags =~ s/&lt;/</g; $tags =~ s/&gt;/>/g; $tags =~ s/<br>/\n/g; open (MAIL, "|$sendmail -t") or die "Cannot access mail"; print MAIL "To: $usermail\n"; print MAIL "From: $adminmail\n"; print MAIL "Subject: Your Meta Tags\n\n"; print MAIL "This is a copy of the meta tags you designed with '$scri +ptname' recently.\n\n"; print MAIL "To install these please paste these codes inside the HEA +D tags of your website.\n\n"; print MAIL "$tags\n\n"; print MAIL "To make new meta tags please come back to $scriptlocatio +n!\n"; close (MAIL); } }

In reply to Meta Tag Generator by sulfericacid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.