Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Programming in HTML and PHP : coding for scientists and engineers
Brooks D., Springer International Publishing, New York, NY, 2017. 293 pp. Type: Book (978-3-319569-72-7)
Date Reviewed: Apr 25 2018

I recently wrote a Perl common gateway interface (CGI) program to display system status on a server running Nginx. This necessitated the installation of an fcgiwrap program to actually call the program, and it was then when I discovered that on the system I was using, I would have to build that program from source. That was when I decided that I should learn PHP!

This book is intended for those who, like me, are scientists and engineers. In its first chapter, it is suggested that readers might use a tool like Notepad on a Windows computer to create and edit both Hypertext Markup Language (HTML) and PHP documents; Notepad++ may have been a better suggestion. A couple of simple HTML documents are shown, and there’s a screenshot showing the result of accessing one of those documents through a Firefox browser. Most of the program documents and data files that appear in this book can be downloaded from the publisher’s website in a single composite text file.

Chapter 2 describes the characteristics of an HTML document and introduces the basic HTML elements and their attributes. Documents that illustrate the use of layout elements, links, and color attributes are shown, and most of these documents are accompanied by a corresponding screenshot. Cascading style sheets are introduced, and there are a couple of examples.

HTML forms and tables provide convenient mechanisms for interfacing with PHP programs, and their usage is covered in chapter 3. The reader is shown how to employ text boxes, radio buttons, and check boxes to collect data on a web page. There is a “Select the Month” example to illustrate the use of pull-down lists. At the end of this chapter there is an interesting frameset example that shows how a window can be divided into several separately addressable blocks of content.

The author observes in chapter 4 that PHP applications require access to a server on which a PHP interpreter has been installed and suggests the installation of an Apache server with an included PHP environment; he notes that one may require a system administrator’s assistance to make this happen. A simple quadratic equation solver PHP script is then shown together with an HTML script that calls it. A compound interest example is also shown to illustrate how a PHP script may be embedded in an HTML document.

A general introduction to the PHP language is given in chapter 5. Examples illustrate statements, data types, operators, and loop structures. The subsequent chapter (“Arrays”) shows how HTML parameters can be passed to PHP programs for processing and subsequent display.

There is a chapter about functions, with an impressive piece of embedded PHP code that uses a recursive function to compute a factorial. Tables of built-in math constants and functions are included, and some of these are used in a Kepler equation example.

The chapter entitled “Input/Output and Functions to Files, Strings and Arrays” shows, as one might expect, how data can be read from or written to a file, and how string contents can be manipulated. What I did not expect was a bizarre example that shows how an invisible text string can be inserted in the padding bytes contained in a bitmap image of a turkey; who knew?

The penultimate chapter introduces the PHP GD graphics library. The author asserts that this library is included as part of current PHP downloads, but that is not the case for some Linux systems. An impressive multicolor pie chart is used for illustrative purposes. There are also some bar charts and line graphs.

PHP can of course be run from the command line, and the final chapter has some examples showing that variables can be passed as command-line arguments or entered in response to prompts during execution. There is also an example in which a test is included to check for command-line arguments; if none are found, then the program considers it is being run on a server, and looks for variables supplied by a “post” method.

The book ends with some appendices showing some ASCII tables and some general strategies for solving computational problems. There are also some interesting exercises relating to each of the book’s chapters.

I found a couple of rather obvious typesetting errors in the book, and one instance where the author forgot that filenames on a Unix or Linux system (like mine) are case-sensitive. But I can wholeheartedly recommend the book to students and practitioners in any technical field.

Reviewer:  G. K. Jenkins Review #: CR145995 (1807-0375)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
HTML (I.7.2 ... )
 
Would you recommend this review?
yes
no
Other reviews under "HTML": Date
HTML for fun and profit (signature edition)
Morris M., SunSoft Press, Mountain View, CA, 1995. Type: Book (9780132424882)
Dec 1 1996
The Web page design cookbook
Horton W., Taylor L., Ignacio A., Hoft N., John Wiley & Sons, Inc., New York, NY, 1996. Type: Book (9780471130390)
Dec 1 1996
Learn HTML on the Macintosh
Lawrence D., Mark D., Addison Wesley Longman Publishing Co., Inc., Redwood City, CA, 1996. Type: Book (9780201887938)
Feb 1 1997
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy