How to Make Your Web Pages Dynamic


PHP can make your pages dynamic on the server side, meaning that, depending on certain circumstances or input, the page will look different. For instance, if I’m logged in on a site, the page may have my name on it, or my account information. That page is built when my browser requests the information. It’s built ‘on the fly’ based on my login information. It’s not a static page, hard-coded in HTML. It changes based on what is asked for by my browser.

Many times we need to make our web pages dynamic on the client side of things. In other words, we need to do something dynamically on the browser side of things – your local computer – instead of at the server side. For instance, if I enter something in a form, I have to submit the form, wait for the PHP code to check to see if what I entered is correct and then send me the results. If my browser were somehow able to check what I entered before it sends it to the website, it could speed things up considerably.

This is where Javascript comes in. Javascript is a scripting language that works inside your browser instead of inside the web server software like PHP. Javascript allows me to send instructions to your browser through the website code. Javascript is responsible for some of the basic animation that you see on web pages such as drop down menus, pop-up boxes, and buttons that change when you move your mouse over them.

Now, there are many javascript libraries that have been built so that we don’t have to re-write everything from scratch every time. This also helps designers and non-programmers use more complex javascript in their web pages without having to understand javascript and programming completely. Libraries such as jQuery, scriptaculous, prototype, and many others help web developers make web pages more dynamic and animated.

PHP and Javascript can work together to make web pages even more dynamic. Sometimes we need information from the server AND information from our local computer or browser. In this case, we can develop web pages with PHP that convert to Javascript code instead of HTML. Using a combination of all these languages together can make some pretty amazing websites!


Leave a Reply