Archive for the 'Guest Posts' Category

Using JavaScript and PHP for Web Development

Today, I bring you a guest post from James Mowery.

When you want a website to do more than just display the same text to every user, you’re moving into the realm of things that will require the use of a programming language. Two of the most popular web development languages are PHP and JavaScript. They can often accomplish the same basic functions, though they’re designed to do it in different ways.

The most critical difference to consider is where the code will be executing. PHP is handled by the server, while JavaScript is processed by the user’s browser. This may initially seem like a minor implementation detail, but it actually has important implications.

The way that it executes means that JavaScript requires that your user be on a browser that supports JavaScript. It must also have this functionality turned on; some users turn off JavaScript support in their browser to improve their computer’s security. On the other hand, JavaScript can execute entirely on the user’s computer without having to contact the server again.

PHP, in contrast, has to contact the server every time a calculation or action needs to be performed. This means that communication between the user and the site will be much more frequent, more bandwidth will be used, and more requests will have to be processed. The need to wait for communication with the server also means that the time between getting input and giving a response is longer. On the other hand, PHP can achieve more sophisticated effects, including generating HTML and JavaScript as needed, and accessing databases.

Both JavaScript and PHP can be useful in setting up a website. Which one is more appropriate for a given situation will depend on the details of a project, and how responsive the servers running it are expected to be. These are issues that should be taken into consideration before any actual code is written.

About the author: James Mowery is a computer geek that writes about technology and related topics. If you wish to read more blog posts by him, he contributes regularly to a blog on laptop computers.

If you wish to contribute a guest post, you can send me an e-mail : victor@nicollet.net



1208 feed subscribers
(readers who polled a feed this week)