473,624 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1663
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****@DavidFil mer.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'',m ap--$|x$_,(unpack'w ',unpack'u','G^ <R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX 0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,red o}#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'',m ap--$|x$_,(unpack'w ',unpack'u','G^ <R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX 0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,red o}#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******@tisca linet.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*********@hj p.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'',m ap--$|x$_,(unpack'w ',unpack'u','G^ <R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX 0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,red o}#JAPH,
Apr 15 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6109
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 information about the user. On another webpage, I have a staff directory which lists all the users. What I would like to do is create a link on the staff directory that will open up this information page with the user specified (instead of the logged...
13
26982
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. http://franz.org/java.htm Thanks for any help.
4
2505
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
16417
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 onClick event to call a script and pass the href URL and link text? That is; We'd like to put an identical piece of JS code into each
2
2135
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 under the heading when a user click on the message header . Message body will come from database table .The different message header has different message body . I have got the message heading showing up on the web page . How do I show the message...
3
2756
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 the two buttons. Once the user clicks on the linkbutton a javascript dialog box popsup that says "Is the Lessee buying this vehicle?" and with two buttons "Yes" and "No". If user clicks "yes" it should go to DealerQuestions.aspx" and if "No" it...
9
3187
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 button is clicked the selected checkboxes values are grouped in a string,which is directed to the same page that displays a link that directs to the required another script.Instead,i want to do it differently.I want the string to be directed to the...
1
1967
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 page...for example: launch_video.php printf("Movie %s: <a href='http://.../embedded_flash_video.html'>%s</a> and 2) I can print the URL as output from server via PHP script...for example: launch_video.php printf("Movie %s: <a...
3
1693
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 out how to implement it. i.e. how to formulate the link so that it will point the script to the page we want to load in the div we want? The script: $(document).ready(function() { // Check for hash value in URL var hash =...
0
8172
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8677
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8620
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.