Welcome Guest ( Log In | Register)



2 Pages V   1 2 >  
Closed TopicStart new topic
> How To Autorefresh A Page Every Two Minutes?
leiaah
post Apr 27 2005, 11:49 PM
Post #1


Super Member
*********

Group: Members
Posts: 436
Joined: 21-January 05
From: Koronadal City, Philippines
Member No.: 3,358



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 smile.gif

Notice from Johnny:
Topic title change per request of owner.


This post has been edited by Johnny: Apr 29 2005, 05:11 AM
Go to the top of the page
 
+Quote Post
leiaah
post Apr 27 2005, 11:53 PM
Post #2


Super Member
*********

Group: Members
Posts: 436
Joined: 21-January 05
From: Koronadal City, Philippines
Member No.: 3,358



QUOTE
Is the idea of an OFFLINE SYSTEM sounds garbage?

My grammar is wrong, sorry...should be "DOES the idea...SOUND (no 'S')" dry.gif
Go to the top of the page
 
+Quote Post
mobious
post May 1 2005, 08:02 AM
Post #3


Advanced Member
*******

Group: Members
Posts: 113
Joined: 14-January 05
From: Philippines
Member No.: 3,271



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.
Go to the top of the page
 
+Quote Post
electriic ink
post May 1 2005, 08:12 AM
Post #4


Incest is a game the whole family can play.
Group Icon

Group: [MODERATOR]
Posts: 1,205
Joined: 11-February 05
From: Heaven
Member No.: 3,709



Sounds like someone's making things too difficult smile.gif

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!
Go to the top of the page
 
+Quote Post
mobious
post May 1 2005, 11:16 AM
Post #5


Advanced Member
*******

Group: Members
Posts: 113
Joined: 14-January 05
From: Philippines
Member No.: 3,271



PHP also has no other way of refreshing a page other than a meta refresh. so just let it be. just blame them for disabling it.
Go to the top of the page
 
+Quote Post
wariorpk
post May 1 2005, 11:40 AM
Post #6


Privileged Member
*********

Group: Members
Posts: 661
Joined: 18-April 05
Member No.: 5,852



Thanks alot cmatcmextra that was a extrememly good explination. Now if I ever need to auto refresh a page I know where I should go.
Go to the top of the page
 
+Quote Post
Mike
post May 1 2005, 12:29 PM
Post #7


Owner of Sub-Zero
********

Group: Members
Posts: 159
Joined: 17-November 04
Member No.: 2,325



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.

CODE


header('Refresh: 120');



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

CODE


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

Go to the top of the page
 
+Quote Post
badinfluence
post May 1 2005, 12:53 PM
Post #8


Super Member
*********

Group: Members
Posts: 283
Joined: 10-October 04
Member No.: 1,637



here are a few, yo might interested..

META-Refresh
simple html meta refresh and why?

Java scripts
Auto refresh page with timer
Auto-Refresh:fixed timer

PHP
Smart Auto Refresh

for chmod, find out here
actually, there are lot of others, if you will use Google search!!
smile.gif
Go to the top of the page
 
+Quote Post
karlo
post May 1 2005, 01:34 PM
Post #9


Privileged Member
*********

Group: Members
Posts: 618
Joined: 30-October 04
From: Philippines
Member No.: 2,049



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

CODE
<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):

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