Script to know who clicked a link?

Discussion in 'Javascript' started by PGPS, Apr 11, 2007.

  1. PGPS

    PGPS Guest

    Hi,
    I want to know who all clicked a particular link (cgi-script) on any
    website.

    1. Link points to my own webserver
    2. Link can be sent anyway. Either emailed or posted on a site which
    needs login

    If emailed, then the email page which shows the link also has the
    users name. When clicked I want to obtain the name.

    If posted on a forum which has a login, I want to get the name (which
    is present in the page having the link).

    HTTP-Referrer doesn't have the username, so it probably is going to be
    a javascript based one.

    The reason for doing this is,
    a) to know who's using my link
    b) to deny access to people who are using it excessively.

    Any ideas?

    Thanks.
     
    PGPS, Apr 11, 2007
    #1
    1. Advertising

  2. PGPS

    Guest

    On Apr 11, 12:27 pm, "PGPS" <> wrote:
    > If emailed, then the email page which shows the link also has the
    > users name. When clicked I want to obtain the name.


    Lemme see if I can drag a bit of clarity out of this question.

    So you send them a link like this:

    http://www.example.com/cgi-bin/stuff.cgi?name=DavidFilmer

    Is that right?

    The name is simply a parameter. If you are using CGI.pm, you can
    simply query it:

    my $username = param('name');

    You can dump it to a logfile or database or whatever (you didn't say
    how you intend to actually keep track of this activity).


    --
    The best way to get a good answer is to ask a good question.
    David Filmer (http://DavidFilmer.com)
     
    , Apr 11, 2007
    #2
    1. Advertising

  3. PGPS

    PGPS Guest

    Thanks, however, I don't want to send them individually.

    Consider I have a profile in a forum, where I can put my own
    javascript code.

    Everyone needs a login.

    So, when someone comes to my profile, the page which shows him my
    profile also has his name on the page (his view)

    Assume that I know how to extract this name from the page.

    When he clicks on this link (javascript probably), it appends his name
    to the link and sends a query like what you stated in your message
    http://www.example.com/cgi-bin/stuff.cgi?name=DavidFilmer


    Any ideas?

    Thanks.
     
    PGPS, Apr 11, 2007
    #3
  4. PGPS

    Matija Zeman Guest

    PGPS wrote:
    > Thanks, however, I don't want to send them individually.
    >
    > Consider I have a profile in a forum, where I can put my own
    > javascript code.
    >
    > Everyone needs a login.
    >
    > So, when someone comes to my profile, the page which shows him my
    > profile also has his name on the page (his view)
    >
    > Assume that I know how to extract this name from the page.
    >
    > When he clicks on this link (javascript probably), it appends his name
    > to the link and sends a query like what you stated in your message
    > http://www.example.com/cgi-bin/stuff.cgi?name=DavidFilmer
    >
    >
    > Any ideas?
    >
    > Thanks.
    >
    >


    LOL

    You really want an XSS attack, but you don't want the cookie, you just
    want a username? :)
    View the source code of the forum page. I assume there is a username of
    the current user inside the DOM. Get it using javascript and append it
    to the link that is so to say dynamically created.

    Is that what you want?

    --
    Matija Zeman
    http://matijazeman.blogspot.hr
    http://matija-zeman.peo.hr
    matija.zeman (at) gmail.com
    matija.zeman (at) fer.hr
     
    Matija Zeman, Apr 12, 2007
    #4
  5. On 2007-04-11 22:13, Michele Dondi <> wrote:
    > On 11 Apr 2007 12:44:51 -0700, "PGPS" <> wrote:
    >>Assume that I know how to extract this name from the page.
    >>
    >>When he clicks on this link (javascript probably), it appends his name
    >>to the link and sends a query like what you stated in your message
    >>http://www.example.com/cgi-bin/stuff.cgi?name=DavidFilmer
    >>
    >>
    >>Any ideas?

    >
    > Yes: it depends on the actual forum. And yes: you probably want to do
    > this in JS if the site permits that


    Which forum would allow that (I mean intentionally - of course lots of
    forums don't sanitize their input properly)? I'd certainly give such a
    site a wide berth.

    > - it's obvious that this must be done on the client of the person who
    > clicks the link!


    Or on the server where the link resides. Doing something like

    print a({-href => ("$url?name=" . remote_user)}, click here)

    is easy. But of course you can do that only on your own server(s).

    hp

    --
    _ | Peter J. Holzer | I know I'd be respectful of a pirate
    |_|_) | Sysadmin WSR | with an emu on his shoulder.
    | | | |
    __/ | http://www.hjp.at/ | -- Sam in "Freefall"
     
    Peter J. Holzer, Apr 15, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leeor Geva
    Replies:
    1
    Views:
    844
    Leeor Geva
    Aug 30, 2003
  2. =?Utf-8?B?R2Vvcmdl?=

    How to know which LinkButton clicked?

    =?Utf-8?B?R2Vvcmdl?=, Apr 6, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    1,791
    =?Utf-8?B?R2Vvcmdl?=
    Apr 6, 2004
  3. ABC
    Replies:
    2
    Views:
    465
    John Timney \( MVP \)
    Jan 14, 2006
  4. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    276
    Gregory Toomey
    Apr 23, 2004
  5. PGPS
    Replies:
    3
    Views:
    123
    Peter J. Holzer
    Apr 15, 2007
Loading...

Share This Page