Jump to content
xisto Community
leiaah

How To Autorefresh A Page Every Two Minutes?

Recommended Posts

I'm working on an OFFLINE SYSTEM that uses PHP and MySQL. Something that can be used by a small network of PC's to do transactions. These are problems I need to solve:1] I need A CODE THAT REFRESHES THE PAGE EVERY TWO OR SO MINUTES. That way the new entries in the database gets seen on the page and I don't have to press F5 or click refresh everytime. 2] How do you set CHMOD PERMISSIONS WHILE USING APACHE AS MY SERVER (OFFLINE)?Is the idea of an OFFLINE SYSTEM sounds garbage? Is it okay to use it for transactions within a small network? SUGGESTIONS WOULD BE HIGHLY APPRECIATED. Thanks in advance -_-

Notice from Johnny:
Topic title change per request of owner.
Edited by Johnny (see edit history)

Share this post


Link to post
Share on other sites

Is the idea of an OFFLINE SYSTEM sounds garbage?

My grammar is wrong, sorry...should be "DOES the idea...SOUND (no 'S')" -_-

Share this post


Link to post
Share on other sites

you could just add a refresh meta in the page that would be refreshed. the idea of an offline system is just right for you because no one will be using your system outside of your personal network.

Share this post


Link to post
Share on other sites

Sounds like someone's making things too difficult -_-It's easier to just use meta refresh - but on the other hand php refresh would mean more people would have the page refreshed. Why? Because you can disable it in most browsers!Anyway, here's the code:<meta http-equiv="refresh" content="120;url=index.php">120 represents 120s (2 minutes) and index.php represents the page you wish to refresh!

Share this post


Link to post
Share on other sites

Actually mobious, you are incorrect. PHP does have a way to refresh a page. Put this at the top of your page *BEFORE* the <head> tag.

 

header('Refresh: 120');

If you want it to refresh to a different link, put this:

 

header('Refresh: 120; url=PAGEYOUWANTTOREFRESHTO');

Share this post


Link to post
Share on other sites

It's easy. I suggest you use JavaScript, because it's the modern way -_-

<script language="javascript" type="text/javascript">setTimeout("location.reload();",20000);</script>

The code above reloads/refreshes the current page every 2 minutes. Also this code (the old way):

<meta http-equiv="refresh" content="120">

Share this post


Link to post
Share on other sites

it's the modern way

It may be the modern way but people still have javascript disabled even if they don't want it to. An annoying virus may come along and disable it for them. There are a lot of idiots out there who don't know how to adjust security settings.

 

Also it's harder to remember. If I had to do it anyway out of those 3, I'd use php because it will refresh for everyone regardless

Share this post


Link to post
Share on other sites

mike, using php to add a refresh to the header is just the same as adding a meta tag in html. the purpose of the the meta tag is to act like the headers being sent to the browser.

Share this post


Link to post
Share on other sites

It may be the modern way but people still have javascript disabled even if they don't want it to. An annoying virus may come along and disable it for them. There are a lot of idiots out there who don't know how to adjust security settings.

 

Also it's harder to remember. If I had to do it anyway out of those 3, I'd use php because it will refresh for everyone regardless

136856[/snapback]

Are you really sure that PHP has a refresh? Do you have a proof? Do you have a website that uses that method? Well, some Ad Remover software, like Ad Muncher, sometimes the user disables META Redirect.

Share this post


Link to post
Share on other sites

Are you really sure that PHP has a refresh?

Yes, they just said and if would be a pretty dumb language if it didn't

Do you have a proof?

Doesn't the Xisto shoutbox use refresh and it does refresh.

Do you have a website that uses that method?

Yes Xisto. It would hard to work it out though because you don't see it in the view source. Even if it doesn't there has to be some website which uses php refresh.

sometimes the user disables META Redirect.

We're not talking about meta redirect, we're talking about php refresh.

If may not work 100% of the time but it will work more often than the other methods. Anyway isn't the point of obtaining a server sided langauge to use it?

Share this post


Link to post
Share on other sites

just to summarize this topic so that everything is clear.Methods for refreshing:JavaScript - not really a good way because end users tend to disable their js support.Meta Refresh - Some say that end users also can disable themPHP Refresh through header() - Most effective i think.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.