Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #11785 > unrolled thread

detecting refresh versus initial page load.

Started byThe Natural Philosopher <tnp@invalid.invalid>
First post2013-11-16 09:18 +0000
Last post2013-11-16 22:11 +0100
Articles 10 — 6 participants

Back to article view | Back to comp.lang.php


Contents

  detecting refresh versus initial page load. The Natural Philosopher <tnp@invalid.invalid> - 2013-11-16 09:18 +0000
    Re: detecting refresh versus initial page load. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-11-16 11:37 +0000
      Re: detecting refresh versus initial page load. The Natural Philosopher <tnp@invalid.invalid> - 2013-11-16 15:34 +0000
        Re: detecting refresh versus initial page load. Derek Turner <frderek@cesmail.net> - 2013-11-16 16:29 +0000
        Re: detecting refresh versus initial page load. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-11-16 16:38 +0000
          Re: detecting refresh versus initial page load. Christoph Michael Becker <cmbecker69@arcor.de> - 2013-11-16 18:11 +0100
            Re: detecting refresh versus initial page load. Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2013-11-16 13:21 -0500
              Re: detecting refresh versus initial page load. Luuk <luuk@invalid.lan> - 2013-11-16 19:30 +0100
                Re: detecting refresh versus initial page load. Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2013-11-16 13:38 -0500
                  Re: detecting refresh versus initial page load. Luuk <luuk@invalid.lan> - 2013-11-16 22:11 +0100

#11785 — detecting refresh versus initial page load.

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-11-16 09:18 +0000
Subjectdetecting refresh versus initial page load.
Message-ID<l67d8v$7f8$1@news.albasani.net>
I want to make behave slightly different the first time you load it to 
when it refreshes itself - it auto refreshes using a meta refresh tag.

Is there anyway to do this WITHOUT cookies and/or Javascript?



-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

[toc] | [next] | [standalone]


#11786

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2013-11-16 11:37 +0000
Message-ID<0.f50de33254678f65771b.20131116113713GMT.87txfcshli.fsf@bsb.me.uk>
In reply to#11785
The Natural Philosopher <tnp@invalid.invalid> writes:

> I want to make behave slightly different the first time you load it to
> when it refreshes itself - it auto refreshes using a meta refresh tag.

If the page is "page.php" you can make the refresh link be something
like "page.php?refreshed=1".  Would that do what you want?

> Is there anyway to do this WITHOUT cookies and/or Javascript?

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#11788

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-11-16 15:34 +0000
Message-ID<l683at$i2t$1@news.albasani.net>
In reply to#11786
On 16/11/13 11:37, Ben Bacarisse wrote:
> The Natural Philosopher <tnp@invalid.invalid> writes:
>
>> I want to make behave slightly different the first time you load it to
>> when it refreshes itself - it auto refreshes using a meta refresh tag.
>
> If the page is "page.php" you can make the refresh link be something
> like "page.php?refreshed=1".  Would that do what you want?
>

But then it is going to refresh itself with the same parameters isn't it?


I don't think short of javascript as a replacement for
<meta http-equiv="refresh" content="107" />

   or whatever, there is any way to do this.


>> Is there anyway to do this WITHOUT cookies and/or Javascript?
>


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


#11789

FromDerek Turner <frderek@cesmail.net>
Date2013-11-16 16:29 +0000
Message-ID<bepkqhFt9b0U2@mid.individual.net>
In reply to#11788
On Sat, 16 Nov 2013 15:34:53 +0000, The Natural Philosopher wrote:

> But then it is going to refresh itself with the same parameters isn't
> it?

No it's going to refresh itself with an additional parameter which can be 
handled with a php

if refresh{...

surely?

The first time that script is executed then refresh is FALSE

or am I missing something?

[toc] | [prev] | [next] | [standalone]


#11790

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2013-11-16 16:38 +0000
Message-ID<0.ed99647d2af0afac394a.20131116163857GMT.87vbzsqp26.fsf@bsb.me.uk>
In reply to#11788
The Natural Philosopher <tnp@invalid.invalid> writes:

> On 16/11/13 11:37, Ben Bacarisse wrote:
>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>
>>> I want to make behave slightly different the first time you load it to
>>> when it refreshes itself - it auto refreshes using a meta refresh tag.
>>
>> If the page is "page.php" you can make the refresh link be something
>> like "page.php?refreshed=1".  Would that do what you want?
>>
>
> But then it is going to refresh itself with the same parameters isn't
> it?

Yes, that seems to meet the specification you gave, but if you want the
behaviour to be different every time, you can generate a different
number for 'refreshed' every time.  This is, after all, a server-
generated page.

> I don't think short of javascript as a replacement for
> <meta http-equiv="refresh" content="107" />
>
>   or whatever, there is any way to do this.

Maybe I am misunderstanding what the "this" is.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#11791

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2013-11-16 18:11 +0100
Message-ID<5287a74a$0$9519$9b4e6d93@newsspool1.arcor-online.net>
In reply to#11790
Ben Bacarisse wrote:

> The Natural Philosopher <tnp@invalid.invalid> writes:
> 
>> On 16/11/13 11:37, Ben Bacarisse wrote:
>>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>>
>>>> I want to make behave slightly different the first time you load it to
>>>> when it refreshes itself - it auto refreshes using a meta refresh tag.
>>>
>>> If the page is "page.php" you can make the refresh link be something
>>> like "page.php?refreshed=1".  Would that do what you want?
>>>
>>
>> But then it is going to refresh itself with the same parameters isn't
>> it?
> 
> Yes, that seems to meet the specification you gave, but if you want the
> behaviour to be different every time, you can generate a different
> number for 'refreshed' every time.  This is, after all, a server-
> generated page.
> 
>> I don't think short of javascript as a replacement for
>> <meta http-equiv="refresh" content="107" />
>>
>>   or whatever, there is any way to do this.
> 
> Maybe I am misunderstanding what the "this" is.

I assume that the OP is not aware that the content attribute optionally
accepts a URI, e.g.:

  <meta http-equiv="refresh" content="5; url=http://example.com/">

However, I'd rather avoid http-equiv=refresh at all.

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#11792

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2013-11-16 13:21 -0500
Message-ID<kIOhu.450289$i75.196082@fx03.iad>
In reply to#11791
On Saturday 16 November 2013 12:11, in comp.lang.php, "Christoph Michael Becker" <cmbecker69@arcor.de> wrote:

> Ben Bacarisse wrote:
> 
>> The Natural Philosopher <tnp@invalid.invalid> writes:
>> 
>>> On 16/11/13 11:37, Ben Bacarisse wrote:
>>>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>>>
>>>>> I want to make behave slightly different the first time you load it to
>>>>> when it refreshes itself - it auto refreshes using a meta refresh tag.
>>>>
>>>> If the page is "page.php" you can make the refresh link be something
>>>> like "page.php?refreshed=1".  Would that do what you want?
>>>>
>>>
>>> But then it is going to refresh itself with the same parameters isn't
>>> it?
>> 
>> Yes, that seems to meet the specification you gave, but if you want the
>> behaviour to be different every time, you can generate a different
>> number for 'refreshed' every time.  This is, after all, a server-
>> generated page.
>> 
>>> I don't think short of javascript as a replacement for
>>> <meta http-equiv="refresh" content="107" />
>>>
>>>   or whatever, there is any way to do this.
>> 
>> Maybe I am misunderstanding what the "this" is.
> 
> I assume that the OP is not aware that the content attribute optionally
> accepts a URI, e.g.:
> 
>   <meta http-equiv="refresh" content="5; url=http://example.com/">

More specifically, if the OP's page is

  http://example.com/mypage.php

then he can code

  <meta http-equiv="refresh" content="5; url=http://example.com/mypage.php?refreshed=1" />

and the php can then determine whether the meta refresh invoked the page or
not, by testing if it passed the "refreshed" option in the GET.

Note that this does not help distinguish initial page loads from page loads
initiated by the browser's "Refresh" option (^R or equivalent).


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

[toc] | [prev] | [next] | [standalone]


#11793

FromLuuk <luuk@invalid.lan>
Date2013-11-16 19:30 +0100
Message-ID<36qkla-t6f.ln1@luuk.invalid.lan>
In reply to#11792
On 16-11-2013 19:21, Lew Pitcher wrote:
> On Saturday 16 November 2013 12:11, in comp.lang.php, "Christoph Michael Becker" <cmbecker69@arcor.de> wrote:
>
>> Ben Bacarisse wrote:
>>
>>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>>
>>>> On 16/11/13 11:37, Ben Bacarisse wrote:
>>>>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>>>>
>>>>>> I want to make behave slightly different the first time you load it to
>>>>>> when it refreshes itself - it auto refreshes using a meta refresh tag.
>>>>>
>>>>> If the page is "page.php" you can make the refresh link be something
>>>>> like "page.php?refreshed=1".  Would that do what you want?
>>>>>
>>>>
>>>> But then it is going to refresh itself with the same parameters isn't
>>>> it?
>>>
>>> Yes, that seems to meet the specification you gave, but if you want the
>>> behaviour to be different every time, you can generate a different
>>> number for 'refreshed' every time.  This is, after all, a server-
>>> generated page.
>>>
>>>> I don't think short of javascript as a replacement for
>>>> <meta http-equiv="refresh" content="107" />
>>>>
>>>>    or whatever, there is any way to do this.
>>>
>>> Maybe I am misunderstanding what the "this" is.
>>
>> I assume that the OP is not aware that the content attribute optionally
>> accepts a URI, e.g.:
>>
>>    <meta http-equiv="refresh" content="5; url=http://example.com/">
>
> More specifically, if the OP's page is
>
>    http://example.com/mypage.php
>
> then he can code
>
>    <meta http-equiv="refresh" content="5; url=http://example.com/mypage.php?refreshed=1" />
>
> and the php can then determine whether the meta refresh invoked the page or
> not, by testing if it passed the "refreshed" option in the GET.
>
> Note that this does not help distinguish initial page loads from page loads
> initiated by the browser's "Refresh" option (^R or equivalent).
>
>

The code mentioned on stackoverflow.com seems more promissing:
http://stackoverflow.com/questions/15033899/js-difference-between-enter-page-and-refresh-page

[toc] | [prev] | [next] | [standalone]


#11794

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2013-11-16 13:38 -0500
Message-ID<mYOhu.267530$rL6.255958@fx14.iad>
In reply to#11793
On Saturday 16 November 2013 13:30, in comp.lang.php, "Luuk"
<luuk@invalid.lan> wrote:

> On 16-11-2013 19:21, Lew Pitcher wrote:
>> On Saturday 16 November 2013 12:11, in comp.lang.php, "Christoph Michael
>> Becker" <cmbecker69@arcor.de> wrote:
>>
>>> Ben Bacarisse wrote:
>>>
>>>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>>>
>>>>> On 16/11/13 11:37, Ben Bacarisse wrote:
>>>>>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>>>>>
>>>>>>> I want to make behave slightly different the first time you load it
>>>>>>> to when it refreshes itself - it auto refreshes using a meta refresh
>>>>>>> tag.
>>>>>>
>>>>>> If the page is "page.php" you can make the refresh link be something
>>>>>> like "page.php?refreshed=1".  Would that do what you want?
>>>>>>
>>>>>
>>>>> But then it is going to refresh itself with the same parameters isn't
>>>>> it?
>>>>
>>>> Yes, that seems to meet the specification you gave, but if you want the
>>>> behaviour to be different every time, you can generate a different
>>>> number for 'refreshed' every time.  This is, after all, a server-
>>>> generated page.
>>>>
>>>>> I don't think short of javascript as a replacement for
>>>>> <meta http-equiv="refresh" content="107" />
>>>>>
>>>>>    or whatever, there is any way to do this.
>>>>
>>>> Maybe I am misunderstanding what the "this" is.
>>>
>>> I assume that the OP is not aware that the content attribute optionally
>>> accepts a URI, e.g.:
>>>
>>>    <meta http-equiv="refresh" content="5; url=http://example.com/">
>>
>> More specifically, if the OP's page is
>>
>>    http://example.com/mypage.php
>>
>> then he can code
>>
>>    <meta http-equiv="refresh" content="5;
>>    url=http://example.com/mypage.php?refreshed=1" />
>>
>> and the php can then determine whether the meta refresh invoked the page
>> or not, by testing if it passed the "refreshed" option in the GET.
>>
>> Note that this does not help distinguish initial page loads from page
>> loads initiated by the browser's "Refresh" option (^R or equivalent).
>>
>>
> 
> The code mentioned on stackoverflow.com seems more promissing:
>
http://stackoverflow.com/questions/15033899/js-difference-between-enter-page-and-refresh-page

Which all appear to involve a Javascript solution.

The OP asked for a solution that worked "WITHOUT cookies and/or Javascript".


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

[toc] | [prev] | [next] | [standalone]


#11797

FromLuuk <luuk@invalid.lan>
Date2013-11-16 22:11 +0100
Message-ID<1l3lla-1eh.ln1@luuk.invalid.lan>
In reply to#11794
On 16-11-2013 19:38, Lew Pitcher wrote:
> On Saturday 16 November 2013 13:30, in comp.lang.php, "Luuk"
> <luuk@invalid.lan> wrote:
>
>> On 16-11-2013 19:21, Lew Pitcher wrote:
>>> On Saturday 16 November 2013 12:11, in comp.lang.php, "Christoph Michael
>>> Becker" <cmbecker69@arcor.de> wrote:
>>>
>>>> Ben Bacarisse wrote:
>>>>
>>>>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>>>>
>>>>>> On 16/11/13 11:37, Ben Bacarisse wrote:
>>>>>>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>>>>>>
>>>>>>>> I want to make behave slightly different the first time you load it
>>>>>>>> to when it refreshes itself - it auto refreshes using a meta refresh
>>>>>>>> tag.
>>>>>>>
>>>>>>> If the page is "page.php" you can make the refresh link be something
>>>>>>> like "page.php?refreshed=1".  Would that do what you want?
>>>>>>>
>>>>>>
>>>>>> But then it is going to refresh itself with the same parameters isn't
>>>>>> it?
>>>>>
>>>>> Yes, that seems to meet the specification you gave, but if you want the
>>>>> behaviour to be different every time, you can generate a different
>>>>> number for 'refreshed' every time.  This is, after all, a server-
>>>>> generated page.
>>>>>
>>>>>> I don't think short of javascript as a replacement for
>>>>>> <meta http-equiv="refresh" content="107" />
>>>>>>
>>>>>>     or whatever, there is any way to do this.
>>>>>
>>>>> Maybe I am misunderstanding what the "this" is.
>>>>
>>>> I assume that the OP is not aware that the content attribute optionally
>>>> accepts a URI, e.g.:
>>>>
>>>>     <meta http-equiv="refresh" content="5; url=http://example.com/">
>>>
>>> More specifically, if the OP's page is
>>>
>>>     http://example.com/mypage.php
>>>
>>> then he can code
>>>
>>>     <meta http-equiv="refresh" content="5;
>>>     url=http://example.com/mypage.php?refreshed=1" />
>>>
>>> and the php can then determine whether the meta refresh invoked the page
>>> or not, by testing if it passed the "refreshed" option in the GET.
>>>
>>> Note that this does not help distinguish initial page loads from page
>>> loads initiated by the browser's "Refresh" option (^R or equivalent).
>>>
>>>
>>
>> The code mentioned on stackoverflow.com seems more promissing:
>>
> http://stackoverflow.com/questions/15033899/js-difference-between-enter-page-and-refresh-page
>
> Which all appear to involve a Javascript solution.
>
> The OP asked for a solution that worked "WITHOUT cookies and/or Javascript".
>
>

a WORKING solution is always better ;)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web