Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

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


The Very Basics

July 21, 2000

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


Why PHP?
Welcome to PHP
PHP Structure


Up to => Home / Authoring / Languages / PHP / Welcome




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers