Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Script to know who clicked a link?

Reply
Thread Tools

Script to know who clicked a link?

 
 
PGPS
Guest
Posts: n/a
 
      04-11-2007
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.

 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      04-11-2007
On Apr 11, 12:27 pm, "PGPS" <(E-Mail Removed)> 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...me=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)

 
Reply With Quote
 
 
 
 
PGPS
Guest
Posts: n/a
 
      04-11-2007
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...me=DavidFilmer


Any ideas?

Thanks.


 
Reply With Quote
 
Matija Zeman
Guest
Posts: n/a
 
      04-12-2007
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...me=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
 
Reply With Quote
 
Peter J. Holzer
Guest
Posts: n/a
 
      04-15-2007
On 2007-04-11 22:13, Michele Dondi <(E-Mail Removed)> wrote:
> On 11 Apr 2007 12:44:51 -0700, "PGPS" <(E-Mail Removed)> 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...me=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.velocityreviews.com/forums/(E-Mail Removed) |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to know who clicked a link? PGPS Perl Misc 3 04-15-2007 11:04 AM
How to I know the previous page is clicked to forward the current page? ABC ASP .Net 2 01-14-2006 09:30 PM
I know, I know, I don't know Andries Perl Misc 3 04-23-2004 02:17 AM
How to know which LinkButton clicked? =?Utf-8?B?R2Vvcmdl?= ASP .Net 4 04-06-2004 04:46 AM
Radio Button List ---> onclick event. You can never know when the user clicked? Leeor Geva ASP .Net 1 08-30-2003 01:09 AM



Advertisments