473,473 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

browser.history and log file

Rg
Hello,
I am very beginner with jscript. I have an Apache PHP enabled
webserver and want to know from where users are coming from.
Understand I want the last surfer's browser visited url.
I imagine I can do this with some kind of interraction
between 2 scripts : one client side, one server side.
The client one send the URL and the server one write it
in the right log file.
I have no idea of how to do this ... Can somebody help?
Any idea appreciated!
Thanks
Rg.

Jul 23 '05 #1
4 1955
Ivo
"Rg" wrote
I am very beginner with jscript. I have an Apache PHP enabled
webserver and want to know from where users are coming from.
Understand I want the last surfer's browser visited url.
I imagine I can do this with some kind of interraction
between 2 scripts : one client side, one server side.
The client one send the URL and the server one write it
in the right log file.
I have no idea of how to do this ... Can somebody help?
Any idea appreciated!


Client-side script can add to this, with info on screensizes and
colourdepths, by making up an image

"log.png?sw="+sreen.availWidth+etc.

where log.png is not only an image, but also runs a serverside logscript.
But if you 're only interested in your user's movements, you only need PHP
and no j(ava)script. The global $_SERVER array holds information on the
referrer. Just write

$_SERVER['HTTP_REFERER'] ---- $_SERVER['PHP_SELF']

to your logfile everytime a page is requested.
Ask in a PHP group for details.
Jul 23 '05 #2
Rg
"Ivo" <no@thank.you> wrote in
news:41**********************@news.wanadoo.nl:
"Rg" wrote
I am very beginner with jscript. I have an Apache PHP enabled
webserver and want to know from where users are coming from.
Understand I want the last surfer's browser visited url.
I imagine I can do this with some kind of interraction
between 2 scripts : one client side, one server side.
The client one send the URL and the server one write it
in the right log file.
I have no idea of how to do this ... Can somebody help?
Any idea appreciated!


Client-side script can add to this, with info on screensizes and
colourdepths, by making up an image

"log.png?sw="+sreen.availWidth+etc.

where log.png is not only an image, but also runs a serverside
logscript. But if you 're only interested in your user's movements,
you only need PHP and no j(ava)script. The global $_SERVER array holds
information on the referrer. Just write

$_SERVER['HTTP_REFERER'] ---- $_SERVER['PHP_SELF']

to your logfile everytime a page is requested.
Ask in a PHP group for details.


thank you to answer....
but you lost me (far away)
I will try php groups
Jul 23 '05 #3
Rg wrote:
Hello,
I am very beginner with jscript. I have an Apache PHP enabled
webserver and want to know from where users are coming from.
Understand I want the last surfer's browser visited url.
I imagine I can do this with some kind of interraction
between 2 scripts : one client side, one server side.
The client one send the URL and the server one write it
in the right log file.
I have no idea of how to do this ... Can somebody help?
Any idea appreciated!
Thanks
Rg.


Properly configured, apache will record the referer for you:

LogFormat "%{Referer}i -> %U" referer
CustomLog /var/log/referer_log referer

or

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
CustomLog /var/log/httpd-access.log combined

In fact, the latter is the way apache comes "out of the box" I
believe. In other words, httpd-access.log should contain a record
of the referer for each request. Personally I use:

LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
SetEnvIf Request_Method ^SEARCH donotlog
CustomLog /var/log/httpd-access.log combined env=!donotlog

Because I want to exclude those 8KB SEARCH requests made by
infected IIS machines.

Writing something in PHP to retrieve the log information and
present it in a meaningful way is left as an exercise for the
student (I'm sure there's plenty of free and open source
solutions out there to do this as well).

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #4
Rg
Grant Wagner <gw*****@agricoreunited.com> wrote in news:411B9A25.68BE0853
@agricoreunited.com:
Subject: Re: browser.history and log file
From: Grant Wagner <gw*****@agricoreunited.com>
Newsgroups: comp.lang.javascript

Rg wrote:
Hello,
I am very beginner with jscript. I have an Apache PHP enabled
webserver and want to know from where users are coming from.
Understand I want the last surfer's browser visited url.
I imagine I can do this with some kind of interraction
between 2 scripts : one client side, one server side.
The client one send the URL and the server one write it
in the right log file.
I have no idea of how to do this ... Can somebody help?
Any idea appreciated!
Thanks
Rg.


Properly configured, apache will record the referer for you:

LogFormat "%{Referer}i -> %U" referer
CustomLog /var/log/referer_log referer

or

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
CustomLog /var/log/httpd-access.log combined

In fact, the latter is the way apache comes "out of the box" I
believe. In other words, httpd-access.log should contain a record
of the referer for each request. Personally I use:

LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
SetEnvIf Request_Method ^SEARCH donotlog
CustomLog /var/log/httpd-access.log combined env=!donotlog

Because I want to exclude those 8KB SEARCH requests made by
infected IIS machines.

Writing something in PHP to retrieve the log information and
present it in a meaningful way is left as an exercise for the
student (I'm sure there's plenty of free and open source
solutions out there to do this as well).

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Exactly what I needed.
I will remain a php student for a long long time
with so good tips :)
Thank you very much.
Rg.
Jul 23 '05 #5

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

Similar topics

21
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" ...
2
by: Michael G | last post by:
Can the browser back button or browser caching be turned on or off via php? Thanks, Mike ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----...
3
by: Rob | last post by:
Each time a webform is posted back (submitted), another URL is added to the browser's history list. My web application allows a back button to return to previously visited pages, but I do not wish...
6
by: David | last post by:
A user logs into a web site. He is then redirected to a web page of his choosing - based on menu options - for example: "WeeklyReport.aspx" is a page the user is currently viewing If the user...
1
by: disaia | last post by:
How can I access the History List of the User's browser from my ASP.NET page? Is there a way to do this? Thanks, Dominic Isaia disaia@earthlink.net
2
by: | last post by:
I am working on an ASP.NET application that seems to be limiting browser histories to only one entry. I am not using SmartNavigation on any of the pages, and that is the only thing that I have...
8
by: Ed Jay | last post by:
I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?...
2
by: Vighneswar | last post by:
Hi All Please let me know is there any way to clear the address bar history ( Typed URLs) of Firefox browser programmatically. Deleting 'index.dat' under profiles folder of firefox will delete...
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
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
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
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,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.