By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,630 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,630 IT Pros & Developers. It's quick & easy.

Script to know who clicked a link?

P: n/a
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.

Apr 11 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Apr 11, 12:27 pm, "PGPS" <premg...@gmail.comwrote:
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)

Apr 11 '07 #2

P: n/a
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.
Apr 11 '07 #3

P: n/a
On 11 Apr 2007 12:35:36 -0700, us****@DavidFilmer.com wrote:
>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?
No, I think that he wants the to be reported the username of the
person who clicks on "his" link when the latter is logged in a site
which has such a login procedure. 'Nuff said...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
Apr 11 '07 #4

P: n/a
On 11 Apr 2007 12:44:51 -0700, "PGPS" <pr******@gmail.comwrote:
>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 - it's obvious that this must be
done on the client of the person who clicks the link! I have no idea
why you think that this may have even remotely to do with Perl.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
Apr 11 '07 #5

P: n/a
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
Apr 12 '07 #6

P: n/a
On 2007-04-11 22:13, Michele Dondi <bi******@tiscalinet.itwrote:
On 11 Apr 2007 12:44:51 -0700, "PGPS" <pr******@gmail.comwrote:
>>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.
| | | hj*@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
Apr 15 '07 #7

P: n/a
On Sun, 15 Apr 2007 13:04:02 +0200, "Peter J. Holzer"
<hj*********@hjp.atwrote:
>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.
Which reminds me of the MySpace Worm story that happened to read some
time ago:

http://blog.outer-court.com/archive/2005-10-14-n81.html
http://namb.la/popular/tech.html
>- 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).
Indeed it's still not entirely clear to me what that the OP wants to
do. But AIUI it's about posting a link in a forum of which he has no
control (I measn, as an admin or a webmaster) and being reported the
forum's username of people who click on said link. I hope not to have
understood correctly.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
Apr 15 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.