PDA

View Full Version : OMG you HAVE to check this out !



Jennifer_English
12-06-2006, 05:38 PM
LOL that got your attention didn't it!!!!!

Hi all :O)

I am hoping one of you marvelously clever PC types can help me...

I created and do all the updates on my website myself and TBH still have a LOT to learn!!

Is there a way to 'force' a refresh on a webpage...

What i mean by this is that every time I update my site you either have to refresh the page to see the recent changes OR wait until your local server updates to show the changes...

Does anyone know how i can get a page to reload automatically just by me adding some script ???

Any advice would be most appreciated...

Jennifer
-x-

jowwor
12-06-2006, 07:36 PM
I think there is an auto-refresh feature in the meta tag on the top... [before in the body-tag]. Maybe you can specify intervals too...

Do a search on meta tag features + auto refresh...

I'm sure there are other ways too...

Great website and great pictures!

-Q-

Jennifer_English
12-06-2006, 09:43 PM
Thanks for your advice :O)

I'll be sure to see what i can find....

Can anyone else help ?


Great website and great pictures!
Thank you sweetie xxxxx

Ultimatejoe
12-06-2006, 10:28 PM
Which area of the site in particular are you hoping to update?

andy8
12-06-2006, 10:30 PM
Hi Jennifer,

Do you escort??

Trans_Lover
12-06-2006, 10:35 PM
http://webtips.dan.info/refresh.html look there

Jennifer_English
12-06-2006, 11:24 PM
Which area of the site in particular are you hoping to update?

well generally the front page has a box telling the visitors when I last did an update... its primarily this that i want to refresh on entry...




Hi Jennifer,

Do you escort??

Sorry I don't...


http://webtips.dan.info/refresh.html look there

Thanks for the link... its not quite what im looking for... but thank you anyway for trying to help...

Jennifer
-x-

scorpion
12-07-2006, 01:46 AM
Yes you got my attention. As always Jennifer. :wink:
Im only sorry that im four no help. :cry:

Ultimatejoe
12-07-2006, 10:50 PM
Ok, can I assume you mean this (http://www.jenniferenglish.co.uk/PE/Update231106guests.gif) image, then you have several options.

If you want to continue to use an image that someone generates each time you update, then you will either need to insert some sort of "refresh" command into the page's header (not the best way to do it), change the file-name with each update and change the page-source accordingly (probably the best way if you have easy access to the source or you can come up with a script to do grab the file-name), or you can figure out some sort of cookie system (the worst way to do it.)

Your other option is to scrap the image entirely and go with a text-based updates box. Using CSS and a bit of patience you could achieve the same effect, and all you would need to do is set up an array on the page, and create a text-file which just has the text and no code. I can show you how to do that pretty easily, and once the changes to your homepage are made, all you'd have to do with an update is open the text file and add a line at the top (eg. "12/23/06 - 11 new images!")

Ecstatic
12-08-2006, 04:04 AM
Is there a way to 'force' a refresh on a webpage...

What i mean by this is that every time I update my site you either have to refresh the page to see the recent changes OR wait until your local server updates to show the changes...
Actually, you always have to refresh the page if you want to see changes, whether that refresh is automatic or manual. But what you're saying about the "local server" sounds like you're concerned about someone viewing a cached version of the page on a proxy server (for instance, if AOL caches the page rather than going back to your server to request the latest version, which makes for greater efficiency on their part but with the chance of viewing outdated data), or simply their own locally cached version of the page (which browsers do to speed things up, serving the last requested version of the page unless you dictate that each time the page loads, it must be the latest version and not a cached version).

Normally, when you submit a request for a page, the first thing sent is the http header. If this header doesn't specify that you must get the latest version of the page, a proxy server may well serve an already-cached version of the page from the last time it was requested (by anyone), which saves the time to go to your server and retreive the page. Also, your browser will cache the last viewed version (as when you hit the back button to go back to a previously-viewed page). To prevent proxy and browser caching and always get the latest version of the page, you'll want to include the following in the <head> tag of the page:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Expires" CONTENT="-1">

Pragma: no cache dictates that you get the latest version of the page; cache-control is another method, and using both is good practive. The expires = -1 sets an immediate expiration on the page, telling the server that the page has expired and you must get the newest non-cached version (or set an already-passed date: <META HTTP-EQUIV="EXPIRES"
CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">; this is technically correct and to be HTTP-compliant, the timestamp must be GMT).


Does anyone know how i can get a page to reload automatically just by me adding some script ???

Any advice would be most appreciated...

Jennifer
-x-
A simple META tag will force a reload of the page:

<META HTTP-EQUIV="REFRESH"
CONTENT="15;URL=http://www.mysite.com/thepage.html">

15 specifies that the page will reload in 15 seconds. However, this can be annoying, especially if it takes a while for the page to reload. I doubt that you really need to do this, but rather just insure that you're serving the latest version of the page and not a cached version.

Here's the code for ASP, PHP, Cold Fusion, and JSP if you're using any of these technologies:

In ASP/IIS:
http://support.microsoft.com/support/kb/articles/Q234/0/67.asp
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>

In PHP:
http://www.php.net/manual/en/function.header.php
<?
Header('Cache-Control: no-cache');
Header('Pragma: no-cache');
?>

In COLD FUSION:
<cfheader name="Expires" value="#Now()#">
<cfheader name="Pragma" value="no-cache">

In JSP:
http://www.jguru.com/faq/view.jsp?EID=377&page=2
<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
%>

Also, if you're running a server-side language like PHP, you can build a simple case/switch statement based on the server clock time to serve different content, for instance, every 10 seconds (note: the content won't reload itself, but every time you load the page, the server system clock will check the time and serve the content indicated). This could be used to always request new content. For example:

<?php $then = getdate( time() );
$now = $then['seconds'];

switch ($now) {

case $now < "15" :
include ("myfile.htm");
break;

case $now < "30" :
include ("myfile.htm");
break;

case $now < "45" :
include ("myfile.htm");
break;

default :
include ("myfile.htm");
break;

}
?>

Using include files is very powerful, by the way, because you don't have to edit the page itself (such as your homepage, which in php would be index.php), but just the file that's being included. And if you have common elements across the site--like the page footer or side navigation or top navigation--you can include the one file which you edit, rather than having to edit all the files on the site if they are all hardcoded.

HTH

Ultimatejoe
12-08-2006, 07:16 PM
Well, my thunder has been officially stolen. I defer to this guy.

Jennifer_English
12-10-2006, 07:20 PM
Ecstatic and Ultimatejoe thanks for your advice.... MOST appreciated...

I'll see if I can get my head around it next week as this weekend was my club night and right now im shattered....

If I need any help I'll be in touch...

Once again... THANKS :O)

Jennifer
-x-

Ecstatic
12-10-2006, 10:26 PM
PM me anytime, Jennifer, and I'll help if I can.