470,848 Members | 1,784 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Reloading a php file?

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.

Dec 29 '05 #1
5 1449
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!

/f3L

Dec 29 '05 #2
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.

Dec 30 '05 #3
Do you have an example of this or know where you can point me to see an
example?

Dec 30 '05 #4
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
information.

Jan 12 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Snolly | last post: by
3 posts views Thread by Richard | last post: by
4 posts views Thread by R | last post: by
9 posts views Thread by andrewfelch | last post: by
1 post views Thread by lukasz.f24 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.