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
Return to the default flat view Create a new topic Submit Reply
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 previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma:
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how change an array
Next Topic: Linking problem
Goto Forum:
  

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

Current Time: Mon Sep 16 19:43:58 GMT 2024

Total time taken to generate the page: 0.05055 seconds