Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Calling a script onto an HTML doc.

by thpfft (Chaplain)
on Oct 24, 2002 at 01:40 UTC ( [id://207600]=note: print w/replies, xml ) Need Help??


in reply to Calling a script onto an HTML doc.

with ssi from an shtml file:

<!--#include virtual="/cgi-bin/sinister_tracking_script.pl"-->

and in sinister_tracking_script.pl:

my $page = $ENV{HTTP_REFERER}; # iirc

or more simply (unless you want to take the opportunity to generate the html for some of the page) and without requiring SSI:

<img src="/cgi-bin/creepy_bug.pl">

and from creepy_bug.pl you can retrieve the page address in the same way, log it and then either return a standard image file, print a counter for old times sake, or just not bother. Note that this method is vulnerable to browser caches and proxies and so on: best to add a unique identifier to the image address each time, so that the browser definitely asks for it. and yes, you can set a cookie while returning an image file, which you can't with ssi-included html.

Don't use this technique on remote pages, btw, especially not with very small images. People will make wild accusations.

ps. google is your friend.

Replies are listed 'Best First'.
Re: Re: Calling a script onto an HTML doc.
by FireBird34 (Pilgrim) on Oct 24, 2002 at 01:45 UTC
    Thanks for the help =) I'll post back here if I can't get it working (unlikely, but you never know what us n00bs can mess up =)).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 19:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found