<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0062)http://www.codecoffee.com/tipsforlinux/articles2/037-php1.html -->
<HTML><HEAD><TITLE>Tips For Linux - A PHP Tutorial for Beginners - Part 1</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY bottomMargin=0 bgColor=#ffffff leftMargin=0 topMargin=0 rightMargin=0
marginwidth="0" marginheight="0">
<DIV align=left>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 name="top bar">
<TBODY>
<TR bgColor=#d7d7d7>
<TD width="15%" bgColor=#d7d7d7>
<DIV align=left><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=-1><B><FONT color=#d7d7d7>.</FONT><FONT color=#ffffff>
</FONT></B></FONT></DIV></TD>
<TD width="46%">
<DIV align=center><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=-1><B><FONT color=#ffffff><FONT color=#000000>Tips For
Linux</FONT></FONT></B></FONT></DIV></TD>
<TD width="15%">
<DIV align=center><A
href="http://www.codecoffee.com/tipsforlinux/index-other.html"><IMG
height=10
src="Tips For Linux - A PHP Tutorial for Beginners - Part 1_files/backtohomepage.jpg"
width=94 align=absMiddle border=0></A></DIV></TD></TR>
<TR bgColor=#ffffff>
<TD colSpan=3>
<DIV align=center><IMG height=7
src="Tips For Linux - A PHP Tutorial for Beginners - Part 1_files/shadowbottom.jpg"
width="100%"></DIV></TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=0 cellPadding=1 width="98%" align=center bgColor=#afafaf
border=0 name="outside table">
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff border=0
name="inside table">
<TBODY>
<TR>
<TD height=19>
<DIV align=left><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=-1><B>>> A PHP Tutorial for Beginners - Part
1</B></FONT></DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<DIV align=center><IMG height=4
src="Tips For Linux - A PHP Tutorial for Beginners - Part 1_files/white.gif"
width=1><BR></DIV>
<TABLE cellSpacing=0 cellPadding=1 width="98%" align=center bgColor=#afafaf
border=0 name="outside table">
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff border=0
name="inside table">
<TBODY>
<TR>
<TD>
<DIV align=left>
<P><FONT face="Verdana, Arial, Helvetica, sans-serif" size=-1>PHP is
an excellent server-side technology for dynamic webpage generation.
Within a span of few years, it has gained immense popularity among
developers. This excellent 5-Part tutorial written by <I>Luigi
Arlotta</I> explains the basics of PHP programming. His style is so
simple that even absolute beginners would have no trouble following
this tutorial. <BR><BR>This tutorial is targeted at those users who
may have never programmed using any language before. Also
programmers who have experience in other languages can quickly
browse through this series and get their PHP code running within
minutes...<BR><BR></FONT></P>
<P><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=-1><B>Introduction</B><BR></FONT></P>
<P><FONT face="Verdana, Arial, Helvetica, sans-serif" size=-1>PHP
stands for "PHP: Hypertext Preprocessor". PHP is a scripting
language through which you can generate web pages dynamically. PHP
code is directly inserted in HTML documents through specific TAGs
declaring the code presence and then executed when a client demands
the page. PHP is a server-side language, that's to say that PHP code
is directly executed by the server, while the client receives
processed results as an HTML document. This way of working is
different from that of other scripting languages as JavaScript,
whose code is first loaded onto the client machine and then executed
by the client (the browser). <BR><BR>A few points to note about PHP
programming -</FONT></P>
<TABLE cellSpacing=2 cellPadding=2 width="98%" align=center
border=0>
<TBODY>
<TR>
<TD vAlign=top align=middle width="6%"><FONT
face="Verdana, Arial, Helvetica, sans-serif"
size=-1>1.</FONT></TD>
<TD width="94%">
<P><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=-1>All compatibility problems existing between different
browsers are completely solved. The Client's browser, receives
a normal HTML page after the execution of a PHP code on the
server, and so it is always able to display it correctly since
it deals with only HTML. This does not happen with scripting
languages interpreted by the client's browser. In this case
the client downloads the script code and tries to process it
on the local machine. This procedure works correctly only if
the client is equipped with the right software (generally
called plugins or built-in support in the browser).</FONT></P>
<P></P></TD></TR>
<TR>
<TD vAlign=top align=middle width="6%"><FONT
face="Verdana, Arial, Helvetica, sans-serif"
size=-1>2.</FONT></TD>
<TD width="94%">
<P><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=-1>The server side code processing sees to it that the
script code is never visible to the clients. That prevents
"thefts" of source code.</FONT></P>
<P></P></TD></TR>
<TR>
<TD vAlign=top align=middle width="6%"><FONT
face="Verdana, Arial, Helvetica, sans-serif"
size=-1>3.</FONT></TD>
<TD width="94%">
<P><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=-1>The server side code execution requires that your
webserver has been well configured. It must be able to
recognize HTML documents containing PHP code. In order to make
this, it is necessary to install a PHP engine and to edit some
lines in the webserver's configuration file.</FONT></P></TD></TR>
<TR>
<TD vAlign=top align=middle width="6%" height=13><FONT
face="Verdana, Arial, Helvetica, sans-serif"
size=-1>4.</FONT></TD>
<TD width="94%" height=13>
<P><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=-1>Server side code processing needs resources (CPU time)
for generating the dynamic pages. A high number of client
requests could overload the server. But generally today's
servers such as Apache are made stable enough to handle a
relatively large number of clients.
</FONT></P></TD></TR></TBODY></TABLE>
<P><FONT face="Verdana, Arial, Helvetica, sans-serif" size=-1>To
make the webserver differentiate between HTML documents containing
PHP code and normal HTML pages, <I>.php</I>, <I>.php4</I> or
<I>.phtml</I> extensions are used in place of the <I>.ht