473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ


What is PHP? Intro

By Blair Ireland
Senior Editor, TheScripts.com

What the heck is PHP?

PHP is a server-side, cross-platform, HTML embedded scripting language. If you are familiar with Cold Fusion (CFM) or Active Server Pages (ASP), then you should understand what this means, as it goes along those lines.

To those of you not familiar with server side scripting languages, they basically allow you to create dynamic web pages. Web pages that have been enabled with PHP are treated just the same as any other HTML page, and PHP even lets you create and edit them the same way you would create and edit your HTML pages.

Now, unlike ASP and CFM, PHP is totally free. PHP is open source software, so you can use it for any commercial or non-commercial project you can think of. That is one of the major reasons PHP is one of the hottest server-side scripting languages. Click here to get PHP.

Before you can make your PHP pages though, it must be installed on your server. Your web host should be glad to install it for you, or it just might already be installed. You will have to ask your web host first though. Also, ask what extension to name your PHP files with. The default extension is .php3, but your server can be configured differently.

When you create your PHP files though, just upload them to your server as normal. The server will do all the work of parsing the files, no need for you to worry.

To make a simple PHP page, create the below file, and call it helloworld.php3. You can do all this in your text editor.

<HTML>
<HEAD>
<TITLE>My first PHP script</TITLE>
</HEAD>
<BODY>
<CENTER>My first PHP script</CENTER>

<?
echo "<center>Hello World<P></center>";
$today = date( "l dS of F Y h:i:s A" );
PRINT "<CENTER>Today is: $today.</CENTER>";
?>
</BODY>
</HTML>

The output of this script would look like

My first PHP script

Hello World

Today is: Sunday 11th of July 1999 04:11:11 PM.

Wondering what all that crud does? Well, first off, the <? starts the boundaries of the PHP script within the page. Basically all PHP commands must be placed within the <? and the ?> tags.

Just like you will find in Perl, pretty much all the PHP commands *must* end with a semi-colon.

  PHP Date and Extras »

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.