Click to See Complete Forum and Search --> : Accessing PHP functions from javascript...


Apollo 11
10-22-2005, 03:38 AM
I read this on another thread... "I can show you how to access any php function you choose (including homemade ones) directly from javascript. (http://www.webdeveloper.com/forum/showthread.php?t=75115&page=2#postmenu_442078)" How is that possible?

felgall
10-22-2005, 05:26 PM
Do a search for AJAX using your favourite search engine and you should find lots of information on how it is done.

MstrBob
10-22-2005, 06:19 PM
It's not exactly "any function you like". Basically, you use javscript to access a separate page, grab the contents of that page, and show it/manipulate it any way you like. So say I have a forum, and I want to show who's online. But I want it to be live, so that a user can see changes without reload the page. Well, I can have javascript access a page, say 'usersonline.php', which when accessed prints out the number of users online. With javascript I collect this and post the results on the page.

Of course, do not rely on this method, as not everyone has Javascript enabled on their browsers.

Brain Storm
10-27-2005, 02:54 PM
Ok, so I have read up on AJAX now and have found no mention of how javascript can access PHP functions, so my question still stands. How is it possible?