1. Home
  2. Computing & Technology
  3. Python

Using PHP and Javascript instead of CGI

By Al Lukaszewski, About.com

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.

8 of 9

Explore Python

More from About.com

  1. Home
  2. Computing & Technology
  3. Python
  4. Web Development
  5. PHP and Javascript for CGI - Looking at the PHP script: Part 2

©2008 About.com, a part of The New York Times Company.

All rights reserved.