Re: previous page button of browser opening on-rev server page

2011-07-27 Thread paolo mazza
Thank you  Dave. I found out that Safary needs an additional attribute
in the body tag :  body onunload= to reload the page.

So, here it is the  code   working for Firefox,  Safari and  IE, both
with PHP and LiveCode server.


PHP

?php
header(Cache-Control: no-cache, no-store,  must-revalidate);
header(Expires: Fri, 30 oct 1998 14:18:41 GMT);
?

html
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
titleDocumento senza titolo/title
/head
body onunload=
?php echo date(Y:m:d-H:i:s); ?
/body
/html


LIVECODE

?rev
put header Cache-Control: no-cache, no-store,  must-revalidate
put header Expires: Fri, 30 oct 1998 14:18:41 GMT
?

html
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
titleDocumento senza titolo/title
/head
body onunload=
?rev
put the long time
?
/body
/html

All the best. Paolo Mazza

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: previous page button of browser opening on-rev server page

2011-07-26 Thread paolo mazza
Thank you all. Trying to get rid of the browser cache setting the
proper headings (as Shao Sean suggested) , I came up with these 2
solutions:

PHP:

?php
header(Cache-Control: no-cache, must-revalidate);
header(Expires: Fri, 30 oct 1998 14:18:41 GMT);
?

?php
$dateTime = date(Y:m:d-H:i:s);
function getDateTime() {
global $dateTime;
return $dateTime;
}
?

html
head
/head
body
?php echo getDateTime() ?
/body
/html

LIVECODE  ... much easyer  ;-)

?rev
put Cache-Control: no-cache, must-revalidate  return  Expires:
Fri, 30 oct 1998 14:18:41 GMT into MYHEADERS
set the httpHeaders to MYHEADERS
put the long time
?

HOWEVER, the first solution (PHP) sets the heathers properly but still
 when I move back and forth with the buttons of the browser I get the
old time  (cache). The second one (LiveCode) does NOT set  the headers
properly (is it a bug?) and the page remains in the browser cache.

Any idea? All the best

Paolo Mazza

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: previous page button of browser opening on-rev server page

2011-07-26 Thread Jan Schenkel
I don't think setting the 'httpHeaders' will do what you want - that's meant 
for getting a URL or posting to a it from within your LC script.

Try this instead (untested, but should do the trick, I think):

?rev
put header Cache-Control: no-cache, must-revalidate
put header Expires: Fri, 30 oct 1998 14:18:41 GMT
put the long time
?


HTH,

Jan Schenkel.

=
Quartam Reports  PDF Library for LiveCode
www.quartam.com

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)


- Original Message -

From: paolo mazza mazzapaoloit...@gmail.com
To: How to use LiveCode use-livecode@lists.runrev.com
Subject: Re: previous page button of browser opening on-rev server page

Thank you all. Trying to get rid of the browser cache setting the
proper headings (as Shao Sean suggested) , I came up with these 2
solutions:

PHP:

?php
header(Cache-Control: no-cache, must-revalidate);
header(Expires: Fri, 30 oct 1998 14:18:41 GMT);
?

?php
$dateTime = date(Y:m:d-H:i:s);
function getDateTime() {
global $dateTime;
return $dateTime;
}
?

html
head
/head
body
?php echo getDateTime() ?
/body
/html

LIVECODE  ... much easyer  ;-)

?rev
put Cache-Control: no-cache, must-revalidate  return  Expires:
Fri, 30 oct 1998 14:18:41 GMT into MYHEADERS
set the httpHeaders to MYHEADERS
put the long time
?

HOWEVER, the first solution (PHP) sets the heathers properly but still
when I move back and forth with the buttons of the browser I get the
old time  (cache). The second one (LiveCode) does NOT set  the headers
properly (is it a bug?) and the page remains in the browser cache.

Any idea? All the best

Paolo Mazza

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: previous page button of browser opening on-rev server page

2011-07-26 Thread Dave Cragg

On 26 Jul 2011, at 07:40, paolo mazza wrote:

 Thank you all. Trying to get rid of the browser cache setting the
 proper headings (as Shao Sean suggested) , I came up with these 2
 solutions:
 
 PHP:
 
 ?php
 header(Cache-Control: no-cache, must-revalidate);
 header(Expires: Fri, 30 oct 1998 14:18:41 GMT);
 ?
 
 ?php
 $dateTime = date(Y:m:d-H:i:s);
 function getDateTime() {
 global $dateTime;
 return $dateTime;
 }
 ?
 
 html
 head
 /head
 body
 ?php echo getDateTime() ?
 /body
 /html
 
 LIVECODE  ... much easyer  ;-)

Not really a fair comparison. The following php script will do the same as your 
Livecode script:

?php
header(Cache-Control: no-cache, must-revalidate);
header(Expires: Fri, 30 oct 1998 14:18:41 GMT);
echo date(Y:m:d-H:i:s);
?

Not so different. :-)

Dave
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: previous page button of browser opening on-rev server page

2011-07-26 Thread paolo mazza
Thank you all.

So,  there is  a property ( header )   only for the on-rev server environment?

In fact I can not use this property in the IDE (I get a compilation
error) and it does not exists in the LC documentation (version 4.6.0).

Are there other undocumented properties suitable only to the server environment?

Actually the script suggested by Jan works, and I get a page with 2
new headers. However, for some reasons, the browser do not reload the
page.

Dave, you are right,  I was unfair with PHP...  still, at least put
the long date  is pretty elegant.

All the best.

Paolo Mazza

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: previous page button of browser opening on-rev server page

2011-07-26 Thread Dave Cragg

On 26 Jul 2011, at 14:54, paolo mazza wrote:
 Actually the script suggested by Jan works, and I get a page with 2
 new headers. However, for some reasons, the browser do not reload the
 page.
 
 Dave, you are right,  I was unfair with PHP...  still, at least put
 the long date  is pretty elegant.

I should apologize as I butted in without following the earlier mails. But your 
problem has got me interested as I didn't know the back button doesn't respect 
the cache settings.

I found this solution using no-store that appears to work for Firefox but not 
Safari. Can't test IE right now.

For PHP...
header(Cache-Control: no-cache, no-store,  must-revalidate);
header(Expires: Fri, 30 oct 1998 14:18:41 GMT);
echo date(Y:m:d-H:i:s);

For Livecode (not tested)

put header Cache-Control: no-cache, no-store, must-revalidate
put header Expires: Fri, 30 oct 1998 14:18:41 GMT
put the long time


Cheers
Dave
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: previous page button of browser opening on-rev server page

2011-07-25 Thread paolo mazza
Hi Mark,
 when I go back with then previous page button of the browser, the
cgi does not run again. The browser simply return the HTML recorded
in the browser cache.
I tried with Safary and with Firefox; both of them do the same thing.
 However, if I empty the cache before returning to the previous page,
the browser runs the cgi again.

Thanks
Paolo

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: previous page button of browser opening on-rev server page

2011-07-25 Thread Shao Sean

Jump down to example two and just do that in your .irev page

http://php.net/manual/en/function.header.php

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: previous page button of browser opening on-rev server page

2011-07-25 Thread Mark Schonewille
I see, Paolo, I misunderstood your questions. As always, do what Shao Sean says 
;-)

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

What does that error mean? Buy LiveCodeErrors for iPhone now http://qery.us/v4 
A must-have for LiveCode programmers.

On 25 jul 2011, at 11:30, paolo mazza wrote:

 Hi Mark,
 when I go back with then previous page button of the browser, the
 cgi does not run again. The browser simply return the HTML recorded
 in the browser cache.
 I tried with Safary and with Firefox; both of them do the same thing.
 However, if I empty the cache before returning to the previous page,
 the browser runs the cgi again.
 
 Thanks
 Paolo


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: previous page button of browser opening on-rev server page

2011-07-25 Thread paolo mazza
Thank you all. Trying to get rid of the browser cache setting the
proper headings (as Shao Sean suggested) , I came up with these 2
solutions:

FIRST ONE WITH PHP

?php
header(Cache-Control: no-cache, must-revalidate);
header(Expires: Fri, 30 oct 1998 14:18:41 GMT);
?

?php
$dateTime = date(Y:m:d-H:i:s);
function getDateTime() {
global $dateTime;
return $dateTime;
}
?

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
titleDocumento senza titolo/title
/head
body
?php echo getDateTime() ?
/body
/html

THE SECOND ONE  WITH LIVECODE  ... much easyer  ;-)

?rev
put Cache-Control: no-cache, must-revalidate  return  Expires:
Fri, 30 oct 1998 14:18:41 GMT into MYHEADERS
set the httpHeaders to MYHEADERS
put the long time
?

HOWEVER,
the first one (PHP) set the heathers properly but still I get the old
time in the page (cache) when I move back and forth with the buttons
of the browser.

The second one (LiveCode) does NOT set  the headers properly (is it a
bug?) and the page remains in the browser cache.

Any idea?

All the best

Paolo Mazza

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode