1. Home
  2. Computing & Technology
  3. Python

Using PHP and Javascript instead of CGI

From , former About.com Guide

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.

Explore Python
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

All rights reserved.