 |
|
Oracle Database Tips by Donald Burleson
|
PHP
PHP is an embedded language similar to Perl. Its name stands for "PHP:
Hypertext Preprocessor". While it is not necessary to understand Perl
before reading this book or developing software application, it is
helpful to have a working knowledge of Perl.
PHP is a weakly typed language in which variables
are preceded by a dollar sign and embedded into HTML. Like HTML tags,
PHP scripts are enclosed with delimiters. They start with <?php and
end with ?>. A traditional introductory example could be a Hello
World program:
<?php
$greeting="Hello
World!";
print $greeting;
?>
Although the variable $greetingcontains a string "Hello World!", its type has not
been declared anywhere. A number or a connection could have easily
been assigned to an Oracle database and assigned to the variable
$greeting. Thus, when displayed in a browser, the program gives
the result shown below:
Now that the most famous program in any language
has been rewritten in PHP, it is time to learn the basics. For the
curious, the following URL describes "Hello World" in most of the
world's computer languages. Sadly, PHP was not included.
http://www2.latech.edu/~acm/HelloWorld.shtml
What is the allure of PHP? PHP is executed completely
on the server side. It is embedded in the HTML language and is
exceptionally easy to program. In version 5, it has all the
ingredients of a major OO (Object Oriented) language. It supports
inheritance, interfaces, constructors and destructors, public, and
private and protected class members.
Any programmer who knows how to use Java or C++
will not have any trouble with OO concepts in PHP. It is also a much
simpler and more standardized way of supporting OO programming than
the method chosen by the designers of Perl.
The first two chapters of this book present a
brief introduction to PHP. This chapter contains the following
sections:
-
-
This section describes operators, expressions and variables.
-
- This section describes Boolean type, strings and arrays.
-
- This section describes conditional statement,
loops and loop control statement.
-
- This section describes PHP super-globals and useful functions.
See
code depot for complete scripts
This is an excerpt from the book
Easy Oracle PHP. You can get it
for more than 30% by buying it directly from the publisher and get
instant HTML-DB scripts from the code depot:
 |
Easy Oracle PHP
Create Dynamic Web Pages with Oracle Data
Includes online HTML-DB code depot
Buy it now for 30% off
- Only $19.95
|
HTML-DB support:
 |
For HTML-DB development support just call to gat an
Oracle Certified professional for all HTML-DB development
projects. |
|