This is a discussion on How to know from where you come? within the PHP Language forums, part of the PHP Programming Forums category; Hi at all I have a little problem (for you) that for me is a mission impossible. I have two ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi at all
I have a little problem (for you) that for me is a mission impossible. I have two web site The first site conain a link to the 2th. and 2th.web site contain a link to the first. I have a log1.txt an a log2.txt to control access. I'ld want writeINTO THEM FROM WHERE VISITOR COME. If visitor come from first web site clicking the link I want to write into the log that visitors come from my first web site amd so on with the 2th. Is it possible? Thank in advance and best regards to all. |
|
|||
|
Pablo wrote:
> Is it possible? Yes. Do some research on HTTP referrers. -- ---------------------------------- Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org- If you learn one useless thing every day, in a single year you'll learn 365 useless things. |
|
|||
|
..oO(Iván Sánchez Ortega)
>Pablo wrote: > >> Is it possible? > >Yes. > >Do some research on HTTP referrers. And on how unreliable they are. What about URL parameters? on site 1: <a href="http://site2.example.com?ref=site1">site 2</a> on site 2: <a href="http://site1.example.com?ref=site2">site 1</a> Micha |
|
|||
|
Michael Fesser wrote:
>>Do some research on HTTP referrers. > > And on how unreliable they are. What about URL parameters? Unreliable as well? -- ---------------------------------- Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org- The very ink with which all history is written is merely fluid prejudice. -- Mark Twain |
|
|||
|
On Jun 27, 5:29 pm, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.org> wrote: > Michael Fesser wrote: > >>Do some research on HTTP referrers. > > > And on how unreliable they are. What about URL parameters? > > Unreliable as well? Well, you have to draw the line somewhere. Unless where the user came from is application essential URL strings are probably your best bet. > > -- > ---------------------------------- > Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org- > > The very ink with which all history is written is merely fluid prejudice. > -- Mark Twain |
|
|||
|
On Thu, 28 Jun 2007 02:47:48 -0000, Benjamin
<musiccomposition@gmail.com> wrote: >On Jun 27, 5:29 pm, Iván Sánchez Ortega <ivansanchez-...@rroba- >escomposlinux.-.punto.-.org> wrote: >> Michael Fesser wrote: >> >>Do some research on HTTP referrers. >> >> > And on how unreliable they are. What about URL parameters? >> >> Unreliable as well? >Well, you have to draw the line somewhere. Unless where the user came >from is application essential URL strings are probably your best bet. >> >> -- >> ---------------------------------- >> Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org- >> >> The very ink with which all history is written is merely fluid prejudice. >> -- Mark Twain > Why not write the data into the file as they click to leave each site - not as they click upon entering each site? |
|
|||
|
joboils@hotmail.com wrote:
> Why not write the data into the file as they click to leave each site > - not as they click upon entering each site? Because there is not a clear and easy way to know when a "user leaves a site". Logging page hits, on the other hand, is pretty trivial. -- ---------------------------------- Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org- Desde luego, la ciencia ha logrado cosas maravillosas, pero yo preferiría, con mucho, ser feliz a tener razón. -- Slartibarfast en "La Guía del Autoestopista Galáctico" |
|
|||
|
On Thu, 28 Jun 2007 09:27:45 +0200, Iván Sánchez Ortega
<ivansanchez-alg@rroba-escomposlinux.-.punto.-.org> wrote: >joboils@hotmail.com wrote: > >> Why not write the data into the file as they click to leave each site >> - not as they click upon entering each site? > >Because there is not a clear and easy way to know when a "user leaves a >site". > >Logging page hits, on the other hand, is pretty trivial. A user leaves a site when they click on a link to do so(!). If a link on site 1 points the visitor to site 2, the script opens a file, adds to the hit number in that file and closes the file again. |
|
|||
|
<joboils@hotmail.com> wrote in message news:4h2783llmqp4qnumivvntrslmqhoq08036@4ax.com... > On Thu, 28 Jun 2007 09:27:45 +0200, Iván Sánchez Ortega > <ivansanchez-alg@rroba-escomposlinux.-.punto.-.org> wrote: > >>joboils@hotmail.com wrote: >> >>> Why not write the data into the file as they click to leave each site >>> - not as they click upon entering each site? >> >>Because there is not a clear and easy way to know when a "user leaves a >>site". >> >>Logging page hits, on the other hand, is pretty trivial. > > A user leaves a site when they click on a link to do so(!). Or if they hit the back button. Or if they choose one of their favourites. Or if they type in a new URL in the address bar. Or if they right click and choose to open the link in a new tab/window. Or if they simply wander off to the pub because the power has failed. You can *never* tell when somebody leaves a site. > If a link on site 1 points the visitor to site 2, the script opens a > file, adds to the hit number in that file and closes the file again. What script? Where? On the client? On the server? On the new page? Surely not on the old page, that has long since gone. And if the viewer chooses to [right-click > open in a new tab] on that link? You will never know. Neither "site" will know. The web is stateless. You do *not* know what has happened previously. -- Richard. |
|
|||
|
..oO(Iván Sánchez Ortega)
>Michael Fesser wrote: > >>>Do some research on HTTP referrers. >> >> And on how unreliable they are. What about URL parameters? > >Unreliable as well? Indeed. None of them is really reliable or secure. Micha |