FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » detecting refresh versus initial page load.
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
detecting refresh versus initial page load. [message #183709] Sat, 16 November 2013 09:18 Go to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
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.
Re: detecting refresh versus initial page load. [message #183711 is a reply to message #183709] Sat, 16 November 2013 11:37 Go to previous messageGo to next message
Ben Bacarisse is currently offline  Ben Bacarisse
Messages: 82
Registered: November 2013
Karma: 0
Member
The Natural Philosopher <tnp(at)invalid(dot)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.
Re: detecting refresh versus initial page load. [message #183713 is a reply to message #183711] Sat, 16 November 2013 15:34 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 16/11/13 11:37, Ben Bacarisse wrote:
> The Natural Philosopher <tnp(at)invalid(dot)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.
Re: detecting refresh versus initial page load. [message #183714 is a reply to message #183713] Sat, 16 November 2013 16:29 Go to previous messageGo to next message
Derek Turner is currently offline  Derek Turner
Messages: 48
Registered: October 2010
Karma: 0
Member
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?
Re: detecting refresh versus initial page load. [message #183715 is a reply to message #183713] Sat, 16 November 2013 16:38 Go to previous messageGo to next message
Ben Bacarisse is currently offline  Ben Bacarisse
Messages: 82
Registered: November 2013
Karma: 0
Member
The Natural Philosopher <tnp(at)invalid(dot)invalid> writes:

> On 16/11/13 11:37, Ben Bacarisse wrote:
>> The Natural Philosopher <tnp(at)invalid(dot)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.
Re: detecting refresh versus initial page load. [message #183716 is a reply to message #183715] Sat, 16 November 2013 17:11 Go to previous messageGo to next message
Christoph Michael Bec is currently offline  Christoph Michael Bec
Messages: 207
Registered: June 2013
Karma: 0
Senior Member
Path: textnews.cambrium.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.141.40 .65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!news feed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Date: Sat, 16 Nov 2013 18:11:44 +0100
From: Christoph Michael Becker <cmbecker69(at)arcor(dot)de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
Newsgroups: comp.lang.php
Subject: Re: detecting refresh versus initial page load.
References: <l67d8v$7f8$1(at)news(dot)albasani(dot)net> <0(dot)f50de33254678f65771b(dot)20131116113713GMT(dot)87txfcshli(dot)fsf(at)bsb(dot)me(dot)uk> <l683at$i2t$1(at)news(dot)albasani(dot)net> <0(dot)ed99647d2af0afac394a(dot)20131116163857GMT(dot)87vbzsqp26(dot)fsf(at)bsb(dot)me(dot)uk>
In-Reply-To: <0(dot)ed99647d2af0afac394a(dot)20131116163857GMT(dot)87vbzsqp26(dot)fsf(at)bsb(dot)me(dot)uk>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Lines: 38
Message-ID: <5287a74a$0$9519$9b4e6d93(at)newsspool1(dot)arcor-online(dot)net>
Organization: Arcor
NNTP-Posting-Date: 16 Nov 2013 18:11:38 CET
NNTP-Posting-Host: 11bd153e.newsspool1.arcor-online.net
X-Trace: DXC=TDWMRRBZU5TV0Pe9PRnbJ\ic==]BZ:af^4Fo<]lROoRQnkgeX?EC@@PZ2OJfBR2YdS]on5W >QlUUPkX?Cbi;2S=_:22ekHR5hC_R9boY;9DVC]
X-Complaints-To: usenet-abuse(at)arcor(dot)de
Xref: textnews.cambrium.nl comp.lang.php:143064

Ben Bacarisse wrote:

> The Natural Philosopher <tnp(at)invalid(dot)invalid> writes:
>
>> On 16/11/13 11:37, Ben Bacarisse wrote:
>>> The Natural Philosopher <tnp(at)invalid(dot)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
Re: detecting refresh versus initial page load. [message #183717 is a reply to message #183716] Sat, 16 November 2013 18:21 Go to previous messageGo to next message
Lew Pitcher is currently offline  Lew Pitcher
Messages: 60
Registered: April 2013
Karma: 0
Member
On Saturday 16 November 2013 12:11, in comp.lang.php, "Christoph Michael Becker" <cmbecker69(at)arcor(dot)de> wrote:

> Ben Bacarisse wrote:
>
>> The Natural Philosopher <tnp(at)invalid(dot)invalid> writes:
>>
>>> On 16/11/13 11:37, Ben Bacarisse wrote:
>>>> The Natural Philosopher <tnp(at)invalid(dot)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
Re: detecting refresh versus initial page load. [message #183718 is a reply to message #183717] Sat, 16 November 2013 18:30 Go to previous messageGo to next message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 16-11-2013 19:21, Lew Pitcher wrote:
> On Saturday 16 November 2013 12:11, in comp.lang.php, "Christoph Michael Becker" <cmbecker69(at)arcor(dot)de> wrote:
>
>> Ben Bacarisse wrote:
>>
>>> The Natural Philosopher <tnp(at)invalid(dot)invalid> writes:
>>>
>>>> On 16/11/13 11:37, Ben Bacarisse wrote:
>>>> > The Natural Philosopher <tnp(at)invalid(dot)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-pag e-and-refresh-page
Re: detecting refresh versus initial page load. [message #183719 is a reply to message #183718] Sat, 16 November 2013 18:38 Go to previous messageGo to next message
Lew Pitcher is currently offline  Lew Pitcher
Messages: 60
Registered: April 2013
Karma: 0
Member
On Saturday 16 November 2013 13:30, in comp.lang.php, "Luuk"
<luuk(at)invalid(dot)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(at)arcor(dot)de> wrote:
>>
>>> Ben Bacarisse wrote:
>>>
>>>> The Natural Philosopher <tnp(at)invalid(dot)invalid> writes:
>>>>
>>>> > On 16/11/13 11:37, Ben Bacarisse wrote:
>>>> >> The Natural Philosopher <tnp(at)invalid(dot)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-pag e-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
Re: detecting refresh versus initial page load. [message #183722 is a reply to message #183719] Sat, 16 November 2013 21:11 Go to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 16-11-2013 19:38, Lew Pitcher wrote:
> On Saturday 16 November 2013 13:30, in comp.lang.php, "Luuk"
> <luuk(at)invalid(dot)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(at)arcor(dot)de> wrote:
>>>
>>>> Ben Bacarisse wrote:
>>>>
>>>> > The Natural Philosopher <tnp(at)invalid(dot)invalid> writes:
>>>> >
>>>> >> On 16/11/13 11:37, Ben Bacarisse wrote:
>>>> >>> The Natural Philosopher <tnp(at)invalid(dot)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-pag e-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 ;)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how change an array
Next Topic: Linking problem
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 04:49:39 GMT 2024

Total time taken to generate the page: 0.02904 seconds