| Topic : Designing Interactive and Usable Ajax Solutions |
|
|
|
|
||
|
Activity:
4 comments
1728 views
last activity : 07 06 2010 20:18:04 +0000
|
||
|
|
PHP is serverside scripting language which can be used along with other web technologies such as javascript(which is client side) and ajax to make interactive web pages. Websites also need databases to store information about users. In this post I want to share what I know is possible using these.
Whenever you open a webpage it's loaded from a webserver usually and that page is not dynamic in nature. With the help of javascript you can make dynamic pages and with ajax and javascript both combined together you can make certain parts of page dynamic. Dynamic functionality can also be made possible with the use of socket/listening server which keeps on listening on a port for any messages but I will not go into specific details on how its done since this post is about general concepts.
Using PHP and MySQL database: You can make user interface for users who can login to your website with login and password.
Using PHP and Javascript: You can introduce dynamic behaviour into your webpage which otherwise is static. As an example in javascript one has an option of keep on calling different javascript functions on different actions of the user like mouseclick, keyboard input etc. Moreover you can keep track of server time and make some function execute only after certain period of page loading.
Using PHP and Javascript and Ajax: You can pass javascript variables to php and display the result from php file on a specific location on HTML page. As an example you have an HTML page with a form. On clicking submit button, a javascript function is called with the value chosen in the form. That javascript function uses XMLHttpRequest object of ajax and sends value of that variable to another PHP file. Depending on the value of that variable PHP file produces some output and that is displayed on HTML page on a specific location using DOM (Document Object Model) property of HTML and using either of XMLHttp.ResponseText or response.Xml objects of ajax depending on your requirement. Response.Xml is required only when you want to retrieve multiple values from PHP file into multiple variables.
In this manner you can save a lot of bandwidth since after submitting a form on an HTML you may not always want to reload the whole page but instead update only few parts of the page.
Also you can have different clients talk to each other even without socket/listening server. This can be done by calling a javascript function each second that uses ajax technology and updates only certain parts per second.
So, you can write your own Chat program using PHP, Javascript, Ajax and MySQL Database.
Queries, comments and suggestions will be appreciated :D
|
|
|
|
|
|
|
|
|
|
Hi Diptanjan, Yes thats true, I have tried to mention many things in a single place. So if you need to understand something specifically please don't hesitate to ask. |
Hi Anirban, What sections you think are ambiguous and need more elaboration ? Please specify if you need to know something in more detail. |
PHP is serverside scripting language which can be used along with other web technologies such as javascript(which is client side) and ajax to make interactive web pages. Websites also need databases to store information about users. In this... |