c-- styles for logos and headline links do not modify internet, red, or black styles -->

Intranet Journal   Earthweb  
Events Jobs Premium Services Media Kit Network Map E-mail Offers Vendor Solutions Webcasts

   Intranet Journal Subjects
Search Earthweb

Privacy Policy



internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

internet commerce
Be a Commerce Partner
















 

[ Home | Discussion Forum | How Do I... | Lotus Notes Intranets | Microsoft SharePoint | Products | Shopping  ]

free news!

Welcome to PHP


An Intranet Design Magazine Tutorial

By Aaron Weiss

The Very Basics

We shouldn't ignore the simple fact that PHP pages require a web server with PHP support. At this time of writing, there are only two real methods of using PHP with a web server: either executing the PHP interpreter from a CGI wrapper, so that PHP runs as any CGI script would, or integrating PHP with the Apache web server. While the CGI wrapper method should work with a wide variety of web servers, it is the least efficient in exeuction speed and resource consumption. Apache+PHP is the preferred solution, although in the future we should also see PHP integrated into other major web servers.

Unfortunately, installing and configuring your web server to properly execute PHP pages is not really the focus of this article, and can be a complex subject due to the variety of operating systems and web servers that might be involved. This article will here on in assume that your web server is already setup to serve PHP pages. If that's not the case, you'll want to begin at the PHP web site (http://www.php.net) to learn how to download and install PHP for your web server. If you don't run a web server, but rather use the services of a web host such as your Internet Service Provider, they will need to support PHP for you.

PHP is not a client-side language. That means that browser never sees PHP -- only the web server sees it, and executes it on-the-fly. The browser receives only a "normal" HTML page. To achieve this, PHP code is contained within a special tag, separating it from the other HTML on the page:

<H2>Today's Headline:</H2><BR>
<P ALIGN="center">
<?php your php code here ?>
</P><HR>

Consider a very simple sample, where the PHP code simply outputs the phrase "World Peace Declared":

what the web server sees what the web browser receives
<H2>Today's Headline:</H2>
<P ALIGN="center">
<?php print "World Peace Declared"; ?>
</P><HR>
<H2>Today's Headline:</H2>
<P ALIGN="center">
World Peace Declared
</P><HR>

And of course, the web browser will render on-screen:

Today's Headline:

World Peace Declared


PHP Structure >

< Why PHP?


[print version of this page]

Welcome to PHP
  1. Introduction
  2. Why PHP?
  3. The Very Basics
  4. PHP Structure
  5. Scalar Variables and Data
  6. Data collection: Arrays
  7. PHP Variables and Web Forms
  8. Operations and Comparisons
  9. PHP Comparison Operators
  10. PHP Logical Operators
  11. Control Statements
  12. The Function of Functions
  13. Object Orientation
  14. Fini