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

calling url.

Hello,

Is it possible, with php, to figure out what the "calling url" is ?

Let's say I have a track.html (with some php code) and if someone
clicks on a link to track.html I want to see the url where that visitor
came from.

can that be done ?

thanks,

Ron
May 8 '06 #1
3 2076
On Mon, 08 May 2006 09:52:36 -0500, Ron Croonenberg wrote:
Hello,

Is it possible, with php, to figure out what the "calling url" is ?

Let's say I have a track.html (with some php code) and if someone clicks
on a link to track.html I want to see the url where that visitor came
from.

can that be done ?


Not 100% reliably (it's up to the browser to send it) but check out
$_SERVER["HTTP_REFERER"]

Cheers,
Andy

--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

May 8 '06 #2
>Is it possible, with php, to figure out what the "calling url" is ?

Let's say I have a track.html (with some php code) and if someone
clicks on a link to track.html I want to see the url where that visitor
came from.

can that be done ?


$_SERVER['HTTP_REFERER'] can be used BUT it's sent by the browser
so it can easily be faked or deleted. This is one of the most
mucked-with variables on the web, even more than cookies. Many
Windows firewalls delete it and their owners couldn't re-enable it
to save their lives (even though that setting is usually in there
somewhere). CURL provides a way to send a fake one. And, of course,
a fake one can be sent by manually typing HTTP headers into telnet.

If you're trying to use it to get an idea where visitors come from,
it might work well enough for your purposes. If you're trying to
prevent references to images on your site from other sites, it's
easy to defeat and it will break your site for legitimate users.
If you think it's a way to detect bots, it's doomed to failure. If
you think it's a way to secure your site with Javascript input
parameter checking only on YOUR form and you can prevent people
from copying your form and altering it, your security is hopelessly
broken.
Gordon L. Burditt
May 8 '06 #3
Neah not trying to do anything fancy like that

Just wanted to see (a bit) where users were coming from
thanks...

Gordon Burditt wrote:
Is it possible, with php, to figure out what the "calling url" is ?

Let's say I have a track.html (with some php code) and if someone
clicks on a link to track.html I want to see the url where that visitor
came from.

can that be done ?

$_SERVER['HTTP_REFERER'] can be used BUT it's sent by the browser
so it can easily be faked or deleted. This is one of the most
mucked-with variables on the web, even more than cookies. Many
Windows firewalls delete it and their owners couldn't re-enable it
to save their lives (even though that setting is usually in there
somewhere). CURL provides a way to send a fake one. And, of course,
a fake one can be sent by manually typing HTTP headers into telnet.

If you're trying to use it to get an idea where visitors come from,
it might work well enough for your purposes. If you're trying to
prevent references to images on your site from other sites, it's
easy to defeat and it will break your site for legitimate users.
If you think it's a way to detect bots, it's doomed to failure. If
you think it's a way to secure your site with Javascript input
parameter checking only on YOUR form and you can prevent people
from copying your form and altering it, your security is hopelessly
broken.
Gordon L. Burditt

May 9 '06 #4

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

Similar topics

1
by: Asapi | last post by:
1. Are linkage convention and calling convention referring to the same thing? 2. Does calling convention differ between languages C and C++? 3. How does calling convention differ between...
8
by: Muthu | last post by:
I've read calling conventions to be the order(reverse or forward) in which the parameters are being read & understood by compilers. For ex. the following function. int Add(int p1, int p2, int...
7
by: Klaus Friese | last post by:
Hi, i'm currently working on a plugin for Adobe InDesign and i have some problems with that. I'm not really a c++ guru, maybe somebody here has an idea how to solve this. The plugin is...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
3
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. ...
2
by: Geler | last post by:
A theoretical question: Sorry if its a beginner question. Here is a quote from the MSDN explaning the C/C++ calling convention.. It demonstrates that the calling function is responsible to clean...
47
by: teju | last post by:
hi, i am trying 2 merge 2 projects into one project.One project is using c language and the other one is using c++ code. both are working very fine independently.But now i need to merge both...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
10
by: sulekhasweety | last post by:
Hi, the following is the definition for calling convention ,which I have seen in a text book, can anyone give a more detailed explanation in terms of ANSI - C "the requirements that a...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.