Page 1 of 2
refresh page to update table contents (from MySQL)
Posted: Thu Oct 23, 2003 4:08 pm
by nataly333
I fill my table from MySQL tables. Each 1 minute i need to update table contents according to the changes in database(made by another people)
Can i do it in php? And how?
Thank you for any help
Posted: Thu Oct 23, 2003 5:25 pm
by Gen-ik
You'll need to use JavaScript (or something similar) to refresh the browser page, PHP can't do anything with the browser.
Posted: Thu Oct 23, 2003 5:26 pm
by CMaLLeTTe
Use a meta refresh tag and make it refresh every 60 seconds
Posted: Thu Oct 23, 2003 6:04 pm
by nataly333
Thank You very much.
To CMaLLeTTe :
Can you write a code, please ?
I can't found any example
Thank You again
Posted: Thu Oct 23, 2003 6:09 pm
by evilmonkey
Here you go Nataly, enjoy.
Code: Select all
<meta http-equiv="refresh" content="60;url=<?php echo $PHP_SELF; ?>">
Notice the 60; you can change that to anything you like (in seconds)
Posted: Thu Oct 23, 2003 6:31 pm
by nataly333
To evilmonkey :
Thank You - Thank You - Thank You !
I do both errors, that means i am a real programmer.
Best regards
Nataly
Posted: Thu Oct 23, 2003 6:35 pm
by evilmonkey
LOL
Best of luck to you.
Posted: Thu Oct 23, 2003 6:51 pm
by nataly333
Doesn't refresh, why?
May be i need some condition ?
Sorry for disturbing, i am really in trouble...
Thank You

Posted: Thu Oct 23, 2003 7:35 pm
by Gen-ik
Try this........
Code: Select all
<meta http-equiv="refresh" content="60;url=<? echo $_SERVERї'PHP_SELF'] ?>">
...........have fun.
Don't forget the code needs to go inside your webpage <head> (in here) </head> tags.
Posted: Thu Oct 23, 2003 8:32 pm
by d3ad1ysp0rk
it works inside the body tags
its supposed to go in the head, but i find it usually needs to go in the body tag.. and it always works
Posted: Thu Oct 23, 2003 9:31 pm
by nataly333
To Gen-ik :
It doesn't works , maybe I need to define something in php.ini ?
Thank you for your help
To LiLpunkSkateR :
It doesn't works not in body tag and not in head tag.What do you think is
a problem ?
Thank you
Posted: Fri Oct 24, 2003 9:12 am
by Gen-ik
LiLpunkSkateR wrote:it works inside the body tags
its supposed to go in the head, but i find it usually needs to go in the body tag.. and it always works
Yes it might work if it goes in the <body> of the page but all meta tags should be placed in the <head> of the page. <meta name="keywords" | <meta name="description | ....... and so on all need to be placed in the page <head>
It's standard practice.
Posted: Fri Oct 24, 2003 9:16 am
by Gen-ik
nataly333 wrote:To Gen-ik :
It doesn't works , maybe I need to define something in php.ini ?
Thank you for your help
To LiLpunkSkateR :
It doesn't works not in body tag and not in head tag.What do you think is
a problem ?
Thank you
Oooh!. Don't forget that (a) your webpage with any PHP in it needs to have a .php extension ( mypage.php for example )... and PHP will only work when it is on-line, it won't work if the PHP page is sitting on your computer... unless your computer is setup as a server.
Posted: Fri Oct 24, 2003 11:12 am
by nataly333
Of course have a .php extension file. One my computer is setup as a server, and second as a client. All another things are working well : connection to MySQL, tables filling...
Only refreshing doesn't work.
That's very odd. It supposed to work, but it doesn't:(
Is it depends on browser?
I remember that it worked. I reinstall php and MySQL, and it stoped to work.
But that is stupid: this is only html tag...?
Posted: Fri Oct 24, 2003 11:15 am
by nataly333
Previous post was for Gen-ik.
Thank You for help and attention.