1. Technology

Using PHP and Javascript instead of CGI


8 of 9

Looking at the PHP script: Part 2

The main output of the script, contained within the first 'print' statement, is a basic re-creation of the earlier webpage. While validation is important, we do not include that markup for reasons of space. If you are unfamiliar with CSS, the 'class' arguments in the HTML refer to subsections of the CSS stylesheet. In this example, I am relying on CSSP to position the output as I would like.

The next print statement prints the contents of $results to the new web page. This PHP script will output anything that comes from the Python program. The flexibility of Python is preserved. Instead of printing search results, as this setup obviously does, this statement could simply say "Thank you for your order. Your Pentalawn 2000 will arrive within the next three weeks."

The third print statement simply closes the HTML markup before the script finishes.

Related Video
Basic PHP Syntax
How to Create a PHP Calendar
  1. About.com
  2. Technology
  3. Python
  4. Web Development
  5. PHP and Javascript for CGI - Looking at the PHP script: Part 2

©2014 About.com. All rights reserved.