473,903 Members | 3,336 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

exit link url variable?

Hey all, I'm trying to create a custom stats script for my site, I'm
new to php and I'm just wondering is there a way to tell what link
someone clicked to leave my site?

So if I've got links to section a, section b, section c, google, yahoo,
msn and someone clicks on google I can record that.

Thanks for your time.

Oct 9 '06 #1
5 16704
Message-ID: <11************ **********@e3g2 000cwe.googlegr oups.comfrom
Robertcode contained the following:
>Hey all, I'm trying to create a custom stats script for my site, I'm
new to php and I'm just wondering is there a way to tell what link
someone clicked to leave my site?

So if I've got links to section a, section b, section c, google, yahoo,
msn and someone clicks on google I can record that.
I think you'll have to organise your links differently.

Instead of having links in the form of
<a href='http://www.google.com' >Google</a>
you could have:
<a href='links.php ?http://www.google.com' >Google</a>

Then in links.php

<?php
$link=$_SERVER['QUERY_STRING'];
//Insert code to record link clicked here in db or file
header("Locatio n: $link");
?>
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Oct 9 '06 #2
Robertcode wrote:
Hey all, I'm trying to create a custom stats script for my site, I'm
new to php and I'm just wondering is there a way to tell what link
someone clicked to leave my site?

So if I've got links to section a, section b, section c, google, yahoo,
msn and someone clicks on google I can record that.

Thanks for your time.
If they are straight links (<a href = 'http://..'>text</a>) there is
absolutely nothing you can do, because any program of yours has finished
before the user ever sees the page containing the link.

However, if you change the links to make them go to a script of yours,
that script can do anything you like.

eg

<a href = 'myscript.php?d est=http%2C%2E% 2Ewww.google.co m'>google</a>

Then you can make your script myscript.php do something like

<?php
$destination = $_GET['dest'];

# Record the jump to $destination in your database or whatever

header('Locatio n: $destination);

?>

I haven't checked the details of what I've written (and I made up the
ASCII values %2E etc in the URL above) but this is roughly right.

Colin
Oct 9 '06 #3
Hmm Robertcode <ro********@gma il.comwrote:
Thanks for your time.
hi, 2 solutions

1. change your links : <a
href="yourLinkG raber.php?url=h ttp://something...... "
2. use onclose option
--
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
Ikciu | gg: 718845 | yahoo: ikciu_irsa | www: www.e-irsa.pl

2be || !2be $this =mysql_query();
Oct 10 '06 #4

..:[ ikciu ]:. wrote:
Hmm Robertcode <ro********@gma il.comwrote:
Thanks for your time.

hi, 2 solutions

1. change your links : <a
href="yourLinkG raber.php?url=h ttp://something...... "
2. use onclose option
--
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
Ikciu | gg: 718845 | yahoo: ikciu_irsa | www: www.e-irsa.pl

2be || !2be $this =mysql_query();
Could someone give me a link to info on the onclose function? I tried
googling it but couldn't find it.

Oct 10 '06 #5
Hmm Robertcode <ro********@gma il.comwrote:
Could someone give me a link to info on the onclose function? I tried
googling it but couldn't find it.
you are so lazy :)

http://www.google.pl/search?hl=pl&q=...j+w+Google&lr=
--
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
Ikciu | gg: 718845 | yahoo: ikciu_irsa | www: www.e-irsa.pl

2be || !2be $this =mysql_query();
Oct 10 '06 #6

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

Similar topics

2
2305
by: John Hoge | last post by:
I would like to open an exit pop when a user leaves my site, but I don't want to the back button to trigger the pop if the user remains in my site. I'm using the onUnload attribute of the Body tag to do this. All internal links set a variable of inSite to true on their onClick event handler, so the exit pop will not open if the user follows an internal link. Should the user hit the back button, the pop will be displayed. Is
9
13617
by: connoisseur.infotech | last post by:
We have a website we need to open popup under following conditions 1) When user close the browser either via X button or alt + f4, file -> Close 2) when he changes URL and goes to some other site. 3) but it should not open the popup window till the user is on same website. we have tried lot of combinations but till date nothing there.
11
11191
by: Yasaswi Pulavarti | last post by:
I know there are some sample user exit programs in sqllib/samples/c directory. How do I tell DB2, which user exit program to use? I know I have to edit and compile the c based user exit programs, but how do I tell DB2 instance and database to use that particular user exit program. Thanks, Yasaswi
7
3143
by: deko | last post by:
I have a function with a number of long loops. While the function is running, I want to be able to click a Stop button and exit the function as quickly as possible. The abbreviated code looks like this: Private Sub cmdStart_Click Call bas1.LongLoops(parameter1, parameter2, parameterN) End Sub
8
5422
by: drose0927 | last post by:
Please help! I can't get my program to exit if the user hits the Escape button: When I tried exit(EXIT_SUCCESS), it wouldn't compile and gave me this error: Parse Error, expecting `'}'' 'else if (choice == 27) exit(0) } }' Here is my program (Simple loop to display currency equivalencies based
6
20100
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are quite a few words in this post but the questions are actually quite similar and should be fairly quick to answer ... (1) What is Happening with the Threads
1
3967
by: webonomic | last post by:
A number of topics ask how to solve the "Cannot use a leading .. to exit above the top directory" error. I am having the same problem with an asp.net 2.0 website. The site works fine on Localhost, but not when I move the site to my hosting company. I've read that turning the Parent Paths option to ON in the IIS properties should do the trick. It is ON for both my localhost and my online host. Only the localhost still works.
6
7735
by: MLH | last post by:
I have a form, frmUSPSReturnReceipts, with a control named NotExpectingGreenTickets. The control's Exit event procedure follows: Private Sub NotExpectingGreenTickets_Exit(Cancel As Integer) If IsNull(Me!NotExpectingGreenTickets) Then DoCmd.CancelEvent Exit Sub End If End Sub
11
2855
by: Rahul | last post by:
Hi Everyone, I have seen code in different styles like main(argc,argv) int argc; char **argv; { if(argc != 2) exit(1); else exit(0);
0
11279
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...
1
10981
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
10499
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...
1
8047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7205
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();...
0
5893
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4725
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
3
3323
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.