473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Script to know who clicked a link?

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
7 1637
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Robert Cohen | last post by:
Hi All, I have what is an easy question for you all, but I have not idea (this is in vbscript). I have this script below that works great. It figures out the user logged in and gives the AD...
13
by: Al Franz | last post by:
Anyone understand how to pass parameters to a JavaScript. If anyone finds this easy to do maybe they could take a look at my short script on this page and show me how it needs to be changed. ...
4
by: Alvaro G Vicario | last post by:
I have a list built on HTML and CSS: <ul> <li>Foo</li> <li>Bar <ul> <li>Gee</li> </ul> </li> </ul>
4
by: Jerry Sievers | last post by:
JS Programmers, "I'm a server-side coder PHP, Postgres etc... My question; Given the following anchor <a href="http://www.somesite.com/somefile.html">link text</a> Is there a way to code an...
2
by: . . | last post by:
Hi I need some help with java script . I have a ASPX page that is pulling a user message heading from the table on the page . The user message header has message body which suppose to dispay...
3
by: Learner | last post by:
Hello, I have two buttons on one of my VehicleDetails.aspx page. Obiviously these two buttons takes the user to two different pages. Now my client is interested in having a linkbutton instead of...
9
by: shara | last post by:
Hello there, I've a script that uses sql,php and html.I need this script to call another script.The script generates check boxes for the users to select, before the button is clicked.But after the...
1
by: Ernest | last post by:
Trying to launch my flash videos by passing their URL listed in a field on MYSQL via PHP script. Any help is greatly appreciated. 1) I am able to launch the video referenced directly in main...
3
by: BobBlock | last post by:
This is a script that, when a link is clicked, will pull a page from somewhere and insert it in a div in the current page. Pretty simple, yes, but being the thick head I seem to be, I can't figure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.