WebDevelopersJournal.comTips on Web Page Design, HTML and Graphics
SITE SEARCH
Newsletters
HTML (M-F) Text (M,TH)


Biz Resources
Contact Management Software
Domain Name Services
Internet Security

Jobs at webdeveloper.com

Resources By Subject
Technical
Graphical
Authoring
Business
WDJ resources
Archive

internet.com

internet.commerce


Developer Channel


Find a web host with:
CGI Access DB Support Telnet Access
NT Servers UNIX Servers



Semi-automatic?

JavaScript
JavaScript Helper:
Meet Paige Turner, the least geeky geek we've ever come across.

Variables and Operators Explained:
First of a three part guide to JavaScript basics.

Controlling Forms:
Enhance your HTML forms with a touch of JS.

DHTML:
Forget how it works, let's see some in action!

Loaner Program: Palm Device Loaner Program. Borrow Palm devices and use them to develop, troubleshoot, test, port, and market applications that leverage Palm technology.

PHP 3.0

by by Ted Brockwood

A free alternative to Cold Fusion or ASP?

Ask most Web application developers their scripting language of choice, and you'll find that most are divided into two camps - the Microsoft Active Server Pages (ASP) folks, and the Cold Fusion users. If you do a little more research however, you'll find there are other options out there, and one of these, PHP 3.0, is in much wider use than one would think for an "alternative product".
January 27, 1999

A recent survey (http://www.php.net/usage.php3) places the number of domains using PHP 3.0 at over 270,000. That's not bad for a completely free scripting language that doesn't even market itself against Microsoft or Allaire.

So what exactly is PHP? At its simplest, PHP is a server-side, cross-platform embedded HTML scripting language. With PHP, you can perform both simple and complex functions with a few lines of additional code. PHP scripting allows you to do everything from "Hello World" popups to database-driven search engines. One of the best things about PHP is that it's totally free, even for those running it on commercial operating systems such as Windows NT.

The PHP scripting language is a hybrid of Perl, Java, and C. Most Webmasters are fairly familiar with at least one of these languages, making PHP a quick language to learn. PHP is very database-friendly, as it can connect to Sybase, MySQL, mSQL, Oracle, and many others (including most ODBC-compliant databases).

PHP code is embedded in standard HTML. Documents must be assigned the ".php3" extension for the interpreter to recognize that they contain scripting. Once the document is properly named, the PHP engine will automatically run the scripts whenever the page is requested.

Looking for an example? Let's begin with the classic "Hello World" code. When a user requests this page, it will be generated as HTML, with the message "Hello World" embedded within it. To the end user, nothing out of the ordinary has happened. They simply requested a page.

First, create an HTML file and name it "hello.php3". Now, input the following lines:

<html><head><title>PHP Test</title></head>
     <body>
     <?php echo "Hello World<P>"; ?>
     </body></html>

Notice the "<?php" and "?>" tags? These let the Web server know that this is PHP code within the tags, and thus to let the PHP interpreter take over. Pretty effortless, right?

Let's get a little trickier. Let's slap together a form for processing. First, create your form page with the following code inside the standard HTML (and remember the ".php3" extension):

<form action="action.php3" method="POST">
     Your name: <input type=text name=name>
     Your age: <input type=text name=age>
     <input type=submit>
     </form>

Next, create another page, named "action.php3". Again, just a standard HTML page but within the code you'll add:

Hi <?php echo $name?>. You are <?php echo $age?> years old.

Now, when the user submits your form, the variable data ($name and $age) are brought over to the results page (action.php3) by the PHP interpreter.

Most work within PHP is really this easy. Database connectivity is as uncomplicated as using Active Server Pages and/or Cold Fusion. PHP has three advantages over the aforementioned scripting languages:

  • Speed and robustness. Whereas ASP tends to slow down a Web server, PHP rarely suffers from such ills. PHP sites rarely, if ever, bog down under heavy loads (unless the server is already under-powered in general).
  • Cross-platform. If you're a Linux, FreeBSD, Solaris, Windows NT, IRIX, HP-UX., or Amiga user, you'll find a distribution of PHP.
  • Ease of use. PHP 3.0 uses a very simple and friendly style of code. Tagging your HTML with PHP scripts is the ultimate in ease, and learning the markup language itself is as effortless as with any other.
If you're a Webmaster in search of a good, easy-to-use scripting language, PHP 3.0 might just be the solution. With such wide (and free) availability, everyone should give it a try. And one last thing...it's Y2K compliant!

More information:

PHP Homepage: http://www.php.net

PHP-to-MySQL database tutorial: http://www.devshed.com/
resource/advanced/php3/intro/index.html

PHPBuilder.com: http://www.phpbuilder.com/

PX The PHP Code Exchange: http://px.sklar.com/

Ted Brockwood is the Information Services Manager for a real estate listing service in Oregon. His experience covers Java, Linux, UNIX, NT, Win95/98, Win3.x, and DOS.
Suits PonytailsPropheadsContact WDJDiscussWeb AudioSearch



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES