My first bit of advice so you kind sir or madam is to not lead off a question like that. It tends to grate on folks and may result in questions going unanswered. IOW: don't grovel! :-)

First I'd recommend you go on over to the Tutorials page and learn how to research for answers on your own.

The first question. BIG HINT: what you are looking for is how to read the CGI headers and find what page has referred the browser to your script. IIRC the variable is HTTP_REFERRER (fat fingers!) HTTP_REFERER and you should be able to get it off the %ENV hash.

Here is an html you can use to test what I am talking about:

<!-- HTML to reference our script --> <a href="/cgi-bin/test.pl">Click Me</a>
and a Perl/CGI script with very minimal functionality:
#!/usr/bin/perl printf "Content-type: text/html\n\n\n"; printf "%s -- %s<br>\n",$_,$ENV{$_} foreach sort keys %ENV;

CAVEAT: Don't leave that code on your production environment as there is some serious information leaking going on there. It is there for demonstration purposes only.

Once you figure out where the user is coming from page wize the rest is using Mail::Send or MIME::Lite or other CPAN module to to send your mail after you have processed it with CGI and some glue code.

The second question. Other monks here have done a bang up job answering that one. The answer lies in the use of CSS and the media attribute (directive?).

With that information in your hands go forth, code and conquor!


In reply to Re: CSS for printing and tell-a-friend scripts by blue_cowdawg
in thread CSS for printing and tell-a-friend scripts by mrtrinity3

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.