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

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 1952
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
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: 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
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
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.