Web Hosting Talk







View Full Version : updating page without refreshing


Uncle Mad
09-22-2007, 11:04 AM
Hi

If i'm coding in PHP, how do i update a page without refreshing the entire page?

Let's say it's a comments box (common feature in friendster), how do i allow the form to be posted and updating the page without refreshing the header?

lexington
09-22-2007, 11:36 AM
Funny you ask this since I was able to create a topic about something similar. Actually this cannot be done in php but in another coding language like AJAX which is what I was about to create a topic about :)

Uncle Mad
09-22-2007, 11:49 AM
:D Haha okay. Actually i kinda know that this cannot be done in PHP, but just want to know if i missed anything out.

Tried to play around with AJAX, but seems like i failed badly for myself.

I have to wait for your topic then. :D

lexington
09-22-2007, 11:55 AM
Oh no my topic asks a similar question so we are in the same boat :P

Uncle Mad
09-22-2007, 12:02 PM
yeah. hope that it's something easy. i don't want to waste too much time on it, though very keen to have it!

anyway, do you know how to have a progress meter running on PHP before an image is being loaded? or it still tinges with AJAX?!

lexington
09-22-2007, 12:04 PM
There are php scripts like that but I was told that none of them work correctly. I believe asp handles things like that. You can do a search on google or hotscripts.com for such scripts.

justforselling1
09-22-2007, 01:54 PM
Ajax prototype library is for this and works really nicely. prototypejs.org

ZackN
09-22-2007, 02:03 PM
This has to be done client-side, most of the time using AJAX. If the form includes file(s) though, only AJAX won't work. There's lots of good tutorials on submitting forms with AJAX, just use google. ;D

juangake
09-25-2007, 09:57 AM
Just for clarifying concepts, AJAX stands for Asynchronous JavaScript And XML

You really don't need anything PHP specific, just knowing a little of Javascript and understand some concepts.

This tutorial may be handy for you both:
http://www.w3schools.com/ajax/default.asp