automatically update

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gasoga
Forum Commoner
Posts: 36
Joined: Thu Apr 17, 2003 4:15 am
Location: Ireland

automatically update

Post by gasoga »

Hey

I was wondering if it is possible to automatically update a webpage when a new row is inserted to the database??

You see when i recieve emails it goes Directly in to the data base but if i want to see if a new email has been sent i have to refresh the page.
Is there anyway that when a new email is sent to the data base it will autmatically appear on the webpage ??

Thanx
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

nope, there is no connection between the webserver and the client after the document has been delivered.
RedRasper
Forum Commoner
Posts: 48
Joined: Thu Apr 24, 2003 6:36 am

Post by RedRasper »

Hi,

Just one thought you could just set the page to refresh every so often though?

<META HTTP-EQUIV="Refresh" CONTENT="300">

The 300 is the time in seconds to refresh the page.

I know its not a brilliant solution, but it might help!

RedRasper
User avatar
KissMyBrain
Forum Newbie
Posts: 2
Joined: Tue Jun 03, 2003 2:22 pm

Post by KissMyBrain »

Hello,

isn't it possible to realize this with a combined php/javascript?
:wink:

I can't describe it very detailled because of my bad english and my rudimentary javascript knowledge, but whats about this:

A JavaScript can make a action in a specified interval. isnt it possible to launch a small php-page in the background which connects to the Database and checks if a change has happen?
the mainpage could be refreshed if anything is changed...
Please correct me if I misunderstood something...

Bye

KissMyBrain
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

Post by Sevengraff »

KissMyBrain wrote:Hello,

isn't it possible to realize this with a combined php/javascript?
:wink:

I can't describe it very detailled because of my bad english and my rudimentary javascript knowledge, but whats about this:

A JavaScript can make a action in a specified interval. isnt it possible to launch a small php-page in the background which connects to the Database and checks if a change has happen?
the mainpage could be refreshed if anything is changed...
Please correct me if I misunderstood something...

Bye

KissMyBrain
people would probally think that the window is a pop-up ad, and close it themselvs, or think badly of the website. The auto-refresh after 300 seconds is a good idea if your page gets updates very often.
Post Reply