Reloading a php file?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Ok, fairly new to php but I am learning. This may be an easy question
but here it goes anyway.

I have a website that is built on php/mysql. My members can send and
get email and instant messages. The problem is for the member to get an
alert that they have a "new message" the page must be reloaded.
Obviously this is a bandwidth kill, plus if the user dosen't pay
attention or view any other pages they will never get an alert.

Does anyone know of a way I can do this in php without reloading the
whole page? In an iframe maybe?

Any help would be greatly appreciated.

Re: Reloading a php file?

do it the easy way, with a reloading iframe and META stuff, or the hard
way, with XMLhttprequest, setTimeout, and Javascript.

either way, you r in for one hell of a ride!


Re: Reloading a php file?

Do you have an example of this or know where you can point me to see an

Re: Reloading a php file?

AJAX Tutorial:

Old JS Guide (Good Start):


Re: Reloading a php file?

Hell ride is more like it. I see that ajax could do the job but it
looks like a complicated way to do it. How would I do it with iframes
and a meta refresh. Keep in mind that I have to pass session

Re: Reloading a php file?

It's one of those times when AJAX is a sensible solution. Use the
setInterval() function to poll the server every now and then. One thing
to remember is to set up Apache so that it'd exclude the polling script
from the server log. Otherwise it'd grow very rapidly.

Site Timeline