Thursday, March 8, 2007

JSP included by PHP

First, PHP manual should be downloaded from: http://de.php.net/download-docs.php

This official handbook is for all the people who want to learn php, from beginner to experienced PHP programmer. It covers everything!!

Here comes what I want to show you:

Funtionally, PHP is much like JSP. And JS can be included in a PHP file very easily. If you wanna create sth shining and simple, to add some little JS into you php page is a very good choice.

For example, I can simplily create a navigation menu by PHP maybe like this:
http://karlcore.com/programming/dynav/menu.phps
this is a good example to use an array to list everything we want to see. But don't you think it is too stiff or mechanical?

Here is a good way to create a drop-down menu with Java Script:
http://www.thesitewizard.com/archive/navigation.shtml
Let the navigation menu stay in good structure and make it a little bit cool! This simple Java Script can manage that.

Here is one more step before you can see your improved menu (in fact, it is also mentioned in the article), you need your PHP file to get into the Java Script and use it! Just simply use a 'include' function in PHP. JS will be parsed rightly into your php environment. Enjoy!

No comments: