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


Groups > comp.lang.php > #5012

Re: Is there a way to distinguish an auto-refresh from a manual page load?

From crankypuss <no@email.thanks>
Newsgroups comp.lang.php
Subject Re: Is there a way to distinguish an auto-refresh from a manual page load?
Date 2012-02-26 11:08 -0700
Organization NewsGuy - Unlimited Usenet $19.95
Message-ID <jidses0ff8@news3.newsguy.com> (permalink)
References (2 earlier) <ji8369$kt8$1@news.albasani.net> <0YGdnbY4GoEdR9XSnZ2dnUVZ_sydnZ2d@cablespeedmi.com> <jib5b4$est$1@dont-email.me> <jicqkr0vkb@news1.newsguy.com> <jid8bg$lbu$1@news.albasani.net>

Show all headers | View raw


On 02/26/2012 05:25 AM, The Natural Philosopher wrote:
> crankypuss wrote:
>> On 02/25/2012 10:21 AM, Beauregard T. Shagnasty wrote:
>>> bill wrote:
>>>
>>>> The Natural Philosopher wrote:
>>>>> Álvaro G. Vicario wrote:
>>>>>> The Natural Philosopher wrote:
>>>>>>> Cos I want to make a page slightly different depending... ..I cant
>>>>>>> think of any parameter I might pass that would be affected by
>>>>>>> autorefersh or not tho.
>>>>>>>
>>>>>>> Maybe javsacript and a timer would enable one?
>>>>>>
>>>>>> The "auto-refresh" concept implies some previous work on your side.
>>>>>> It'd help a lot to know what's the code you wrote to accomplish it
>>>>>> (JavaScript,<meta> tag or whatever). Whatever, I have the impression
>>>>>> that it'd help even more to know the problem you want to fix rather
>>>>>> than just the solution you figured out.
>>>>>
>>>>> Well I used a meta tag so that the client refreshes in case new info
>>>>> has come in.
>>>>>
>>>>> However in this case the client can also POST new information, and I
>>>>> don't want it POSTING the same information every 5 minutes or
>>>>> whatever.
>>>>>
>>>>>
>>>>> The idea is to construct a not very real time view (5 minute
>>>>> granularity is good enough) on some data, some of which the user can
>>>>> change.
>>>>>
>>>>> I haven't tested it to see if a refresh is actually different from a
>>>>> submit.
>>>>
>>>> UNTESTED:
>>>> On the original submit, attach a parameter with a random number.
>>>> Keep the sequence number in your database. On every invocation
>>>> of the php script, check the number in the database. If it is the same
>>>> as last time, it is a refresh. bill
>>>
>>> ..unless another visitor views the page in between. This 'database'
>>> would
>>> have to also include at least the IP address and the random number, or
>>> perhaps the IP and the date/time and the random number to ever have a
>>> shot at being close.
>>
>> That's where the concept of a user session comes in handy. I've been
>> doing other things for some time now, but prior to that I was building
>> a text editor and it was able to flawlessly detect re-sends of POST-ed
>> information, etc. The underlying code is doubtless more complex than
>> most people would care to deal with, but it is possible.
>
> I haven't got around to testing this, but it has been interesting
> hearing deas - so thanks for all those.
>
> It occurs to me if I do refresh under Javashite I can always hand set a
> variable to say 'ignore the post variables, if they happen to be set'
>
> BUT I have to say I am attracted to playing with web sockets sim0ply
> because its new and a bit of a challenge. That avoids the need to
> refresh the page ...at all.

I've never been successful in digging around to find out how the few web 
pages I've seen are able to update the page without constant flickering 
and so on, it's my impression (*not* understanding, I lack that) that 
http is a client/server protocol and that once a request has been 
fulfilled the transaction is over.  I'm curious, but not compelled.

On the other hand I have been somewhat successful in creating the same 
appearance by using closely spaced refreshes, most browsers seem not to 
clear the screen prior to rendering so if the next is mostly the same as 
the last it appears to have been partially updated.

I'm not sure what you mean by "web sockets", I've used the kind of 
sockets provided by PHP but if you mean something else I've no clue what 
that might be.

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Is there a way to distinguish an auto-refresh from a manual page load? The Natural Philosopher <tnp@invalid.invalid> - 2012-02-22 22:26 +0000
  Re: Is there a way to distinguish an auto-refresh from a manual page load? Scott Johnson <noonehome@chalupasworld.com> - 2012-02-22 16:27 -0800
  Re: Is there a way to distinguish an auto-refresh from a manual page load? Jerry Stuckle <jstucklex@attglobal.net> - 2012-02-22 22:49 -0500
  Re: Is there a way to distinguish an auto-refresh from a manual page load? "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-02-24 13:40 +0100
    Re: Is there a way to distinguish an auto-refresh from a manual page load? The Natural Philosopher <tnp@invalid.invalid> - 2012-02-24 13:26 +0000
      Re: Is there a way to distinguish an auto-refresh from a manual page load? bill <nobody@spamcop.net> - 2012-02-25 07:56 -0500
        Re: Is there a way to distinguish an auto-refresh from a manual page load? "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2012-02-25 17:21 +0000
          Re: Is there a way to distinguish an auto-refresh from a manual page load? crankypuss <no@email.thanks> - 2012-02-26 01:31 -0700
            Re: Is there a way to distinguish an auto-refresh from a manual page load? The Natural Philosopher <tnp@invalid.invalid> - 2012-02-26 12:25 +0000
              Re: Is there a way to distinguish an auto-refresh from a manual page load? crankypuss <no@email.thanks> - 2012-02-26 11:08 -0700
                Re: Is there a way to distinguish an auto-refresh from a manual page   load? "J.O. Aho" <user@example.net> - 2012-02-26 19:40 +0100
                Re: Is there a way to distinguish an auto-refresh from a manual page load? crankypuss <no@email.thanks> - 2012-02-26 13:06 -0700
                Re: Is there a way to distinguish an auto-refresh from a manual page load? The Natural Philosopher <tnp@invalid.invalid> - 2012-02-26 21:12 +0000
                Re: Is there a way to distinguish an auto-refresh from a manual page load? "Peter H. Coffin" <hellsop@ninehells.com> - 2012-02-26 12:44 -0600
                Re: Is there a way to distinguish an auto-refresh from a manual page load? crankypuss <no@email.thanks> - 2012-02-26 13:09 -0700
                Re: Is there a way to distinguish an auto-refresh from a manual page load? The Natural Philosopher <tnp@invalid.invalid> - 2012-02-26 21:14 +0000
                Re: Is there a way to distinguish an auto-refresh from a manual page load? crankypuss <no@email.thanks> - 2012-02-27 04:02 -0700
      Re: Is there a way to distinguish an auto-refresh from a manual page load? "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-02-27 10:22 +0100
        Re: Is there a way to distinguish an auto-refresh from a manual page load? The Natural Philosopher <tnp@invalid.invalid> - 2012-02-27 12:00 +0000
          Re: Is there a way to distinguish an auto-refresh from a manual page load? "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-02-27 14:08 +0100
            Re: Is there a way to distinguish an auto-refresh from a manual page load? The Natural Philosopher <tnp@invalid.invalid> - 2012-02-27 14:12 +0000
              Re: Is there a way to distinguish an auto-refresh from a manual page load? "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-02-27 17:18 +0100
                Re: Is there a way to distinguish an auto-refresh from a manual page load? Jerry Stuckle <jstucklex@attglobal.net> - 2012-02-27 11:59 -0500

csiph-web