Using HTML Embedded Scripting with Oracle Web Applications
So far in this chapter, we’ve looked at how you can build open source web-based applications with Perl and Java technologies that use CGI scripts. Another approach to dynamic web programming is to use embedded scripting. With the embedded scripting approach, you embed snippets of code in your HTML pages, rather than writing CGI programs that output HTML pages. This is an elegant way to separate web and database programming from web page design (though the separation works well only if the embedded language is a simple and straightforward one).
There are various web programming solutions loosely based on the idea of embedding code into HTML pages and then preprocessing it. With Java, for example, you use JavaServer Pages (JSP), as we mentioned in the previous section. Microsoft’s version of this technology is known as Active Server Pages (ASP). There are also a number of excellent open source solutions. In this section we’ll take a look at four exciting and widely used open source solutions: PHP, EmbPerl, Mason, and Aquarium.
PHP is a powerful embedded scripting language that supports an extensive set of Oracle functions. PHP differs from CGI scripting in a fundamental way. With CGI scripting, you return an HTML page that’s generated directly as the result of running your script. PHP lets you generate dynamic web pages simply by embedding pieces of PHP code inside your HTML. PHP is similar to JavaServer Pages, Active ...