Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: CSS for printing and tell-a-friend scripts

by blue_cowdawg (Monsignor)
on Dec 07, 2004 at 16:09 UTC ( [id://412931]=note: print w/replies, xml ) Need Help??


in reply to CSS for printing and tell-a-friend scripts

      Hi, I'm a newbie, so I apologize if I'm taking up anybody's time with these questions,

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!

Replies are listed 'Best First'.
Re^2: CSS for printing and tell-a-friend scripts
by BUU (Prior) on Dec 07, 2004 at 22:36 UTC
    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 and you should be able to get it off the %ENV hash.
    I believe if you'll look at the spec, you'll find that it's actually HTTP_REFERER.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://412931]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found