Update Without Refresh

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
ForSale
Forum Newbie
Posts: 2
Joined: Wed Apr 18, 2012 8:49 pm

Update Without Refresh

Post by ForSale »

Hi all. :D

I am a new comer to PhP but enjoying it so far. I am just curious about one thing though. I have started building a site but would appreciate help in the following regard.

On the sites editing page there will be multiple options the user can play around with such as check boxes, input fields etc to choose and edit information about an item such as a blue shirt(checkbox), with red stripes(input field).

My question be fore i get started on the meat of this project would be is it at all possible for to have this information updated automatically and reflect in the corresponding fields without needing to refresh the page each time to view the changes?

I ask because i have heard this can cause serious problems for people using a screen reader, so would like to make it as easy for the viewers as possible with minimal problems. For eg, is there an inbuilt function in PhP i could use to achive this and just add custom parameters etc?

I appreciate any help you could give regarding this matter.
User avatar
Robert07
Forum Contributor
Posts: 113
Joined: Tue Jun 17, 2008 1:41 pm

Re: Update Without Refresh

Post by Robert07 »

You can use ajax to do this in real time without refreshing the page (which might be more user friendly for screen readers), or you can load everything into hidden divs and use javascript/css to update what values appear where and which content is shown on the screen at any given time.
ForSale
Forum Newbie
Posts: 2
Joined: Wed Apr 18, 2012 8:49 pm

Re: Update Without Refresh

Post by ForSale »

Thanks alot, i will definately look into that.

Just out of cusiosity though, with the right functions implemented and such would it be possible to implement this in straight php and html without needing to incorporate other languages?
User avatar
Robert07
Forum Contributor
Posts: 113
Joined: Tue Jun 17, 2008 1:41 pm

Re: Update Without Refresh

Post by Robert07 »

No, because php is a server side language. When the page is done loading php is done, but Javascript (which is combined with php or other server side code to make ajax) is a client side language which allows for changes to be made dynamically after the page finishes loading.
User avatar
Robert07
Forum Contributor
Posts: 113
Joined: Tue Jun 17, 2008 1:41 pm

Re: Update Without Refresh

Post by Robert07 »

You can take a look at an article I wrote about ajax to understand the gist of that, it is at http://www.wilycode.com/the-essence-of- ... n-an-hour/.
Post Reply