473,388 Members | 1,524 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,388 software developers and data experts.

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 16676
Message-ID: <11**********************@e3g2000cwe.googlegroups. 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("Location: $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?dest=http%2C%2E%2Ewww.google.com'>go ogle</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('Location: $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********@gmail.comwrote:
Thanks for your time.
hi, 2 solutions

1. change your links : <a
href="yourLinkGraber.php?url=http://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********@gmail.comwrote:
Thanks for your time.

hi, 2 solutions

1. change your links : <a
href="yourLinkGraber.php?url=http://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********@gmail.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
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...
9
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....
11
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,...
7
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...
8
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 `'}''...
6
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...
1
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...
6
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...
11
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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...

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.