Home > Teaching > Tutorials > HTML Tutorial

Javascript and DHTML

These are really intertwined -- much that is classified as DHTML is Javascript. A strictly HTML page is pretty much static whereas Javascript and DHTML are good for making pages active and respond to users. Javascript/DHTML can be inserted into HTML pages. Examples of what one can do include simple computations (have users input data and then have the result output on the page immediately), control how new windows open, or make mouse-over effects. The tutorial and many examples on w3schools.com is a good place to go to learn more on these topics.

PHP and MySQL

Like Javascript, PHP is a web scripting language. However, the difference is that PHP is compiled on the server, meaning the user never sees the PHP code. The advantages of PHP are numerous, but the most obvious is that it works smoothly with MySQL, a database program. Users can input data in a form and it can be saved into a MySQL table. Otherwise one can also save information about the users who visit certain pages (such as browser type). However, my favorite PHP function is unrelated to MySQL -- it is include():

<?php include("file_to_be_included.php"); ?>

This includes the entire file specified. Why is this useful? Lines of code to be included on all pages can be put in a single file, making it easy to alter an appearance on all pages very quickly -- simply alter the referenced file.

Anything not enclosed in <?php and ?> is treated as simple HTML in PHP and left alone. This means all .html files can simply be .php instead without any loss of functionality. Doing this from the beginning also means, if you do decide to start work with PHP, you need not go through the hassle of changing all the .html files to .php files (along with all the links between the pages).

Much more information and an excellent tutorial on PHP may be found on w3schools.com

Previous: cascading style sheets Next: ideas and styling