18
PHP Introduction & Overview Fort Collins, CO Copyright © XTR Systems, LLC Introduction to & Overview of PHP Instructor: Joseph DiVerdi, Ph.D., MBA

Introduction to & Overview of PHP

Embed Size (px)

DESCRIPTION

Introduction to & Overview of PHP. Instructor: Joseph DiVerdi, Ph.D., MBA. PHP In Brief. PHP Is A Server-Side HTML-Embedded Cross-Platform Programming Language Provides a Means for Developers to Put Instructions in HTML Files to Create Dynamic Content. Explanations. Server-Side - PowerPoint PPT Presentation

Citation preview

Page 1: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

Introduction to&

Overview of PHP

Instructor: Joseph DiVerdi, Ph.D., MBA

Page 2: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP In Brief

• PHP Is A– Server-Side– HTML-Embedded– Cross-Platform– Programming Language

• Provides a Means for Developers to Put Instructions in HTML Files to Create Dynamic Content

Page 3: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

Explanations

• Server-Side– PHP Code is Executed on the Server

• HTML-Embedded– PHP Code is Inserted Directly in HTML

• Cross-Platform– PHP Runs on Several Different (Server) OSes

• Scripting Language– Difference Between Scripting & Programming

Languages is Increasingly Small• More Semantic than Significant

– Script is Not Compiled

Page 4: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP in Less Brief

• PHP Provides a Means for Developers– To Put Instructions in HTML Files– The Instructions are Read & Parsed by Server

• They Never Make It to the Browser

– The Server Replaces PHP Code with Content• HTML etc.

– Forerunner Technology is• Server Side Includes (SSI)

Page 5: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

Other Developments

• Need for HTML-Embedded Server-Side Scripting Technology was Apparent to Others

• Microsoft went after this need with ASP – Active Server Pages

• ASP Has Become Quite Popular– In Microsoft Shops

• Many Developers Sought More Stable & Less Proprietary Solution– Enter PHP, an Open-Source Server-Parsed

HTML-Embedded Programming Language

Page 6: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Benefits

• PHP's Primary Strength– Rapid Development of Web Pages

• With Modest Amount of Dynamic Content

– Developers Without Heavy Programming Experience

• Enjoy PHP's Shallow Learning Curve

– Complete Tasks Of Modest Complexity• Pulling Records From a Database & • Inserting Them Into an HTML Table

Page 7: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Benefits

• PHP Language Architecture– Simple but Powerful– Includes an Extremely Wide Variety of Functions

• Suited for Many Tasks– Traditional Data Processing

– Web-Oriented Functions

Page 8: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Example

<HTML>

<HEAD>

<TITLE>Welcome!</TITLE>

</HEAD>

<BODY>

<?PHP phpinfo() ?>

<!-- more HTML goes here... -->

</BODY>

</HTML>

Page 9: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Weaknesses

• PHP Remains an Immature Language– Without the Architectural Strengths or Extensibility

of More Established Languages

• Embedded Scripting– Program Code is Mixed With HTML

• Some Developers Are Empowered By This• Others Find It Disorganized & Error-Prone

– Prefer Separate Development Environments• For Each Web Component

Page 10: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Weaknesses

• Advanced Developers – With Experience in Perl, CGI, & mod_perl

• May Find Less Reason to Spend Time with PHP• And This May be Entirely Justified

– Because They Can Already Do What PHP Can

Page 11: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Strengths

• Developers Have Literally Flocked to PHP– Modest Learning Curve– Free & Open Development– Native Database Connectivity– Stability– Availability for a Variety of Server Platforms

Page 12: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

In Summary

• It is Important to Understand That PHP is not a Unique Solution to Web Development– We're Fortunate to Enjoy a Potpourri of Possible

Web Development Tools

• Many Tasks can be Performed with a Wide Variety of Technologies– Developers Must Weigh Many Factors in

Choosing a Development Path• Previous & Current Experience• Platform Requirements & Support• Time-to-Market Requirements

Page 13: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Documentation

• PHP Is Still in an Early Stage of Development• Language Continues to Evolve Significantly• Printed Texts Tend to Lag Behind• Most Current Information Available On-Line• PHP On-Line Manual

http://www.php.net/manual/en/

Page 14: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Example

<!DOCTYPE ... >

<HTML>

<HEAD>

<TITLE>PHP Test Page</TITLE>

</HEAD>

<BODY>

<?PHP phpinfo() ?>

</BODY>

</HTML>

• Create File Named "php_info.php"

Page 15: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Example

<!DOCTYPE ... >

<HTML>

<HEAD>

<TITLE>PHP Test Page</TITLE>

</HEAD>

<BODY>

<?PHP print("<P>Here is some text.</P>"); ?>

</BODY>

</HTML>

• Create File Named "test.php"

Page 16: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Example

<?PHP

print("<P>\n");

print("Here is some text.\n");

print("</P>\n");

?>

• Modify "test.php"

Page 17: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Example

<!DOCTYPE ... >

<HTML>

<HEAD><TITLE>PHP Date Page</TITLE></HEAD>

<BODY>

<?PHP

print("<P>\n");

print("The current date is: ");

print(date("l F j, Y"));

print("</P>\n");

?>

</BODY>

</HTML>

• Create File Named "date.php"

Page 18: Introduction to & Overview of  PHP

PHP Introduction & OverviewFort Collins, CO

Copyright © XTR Systems, LLC

PHP Example

<!DOCTYPE ... >

<HTML>

<HEAD><TITLE>PHP Time & Date Page</TITLE></HEAD>

<BODY>

<?PHP

print("<P>\n");

print("The current time and date are: ");

print(date("H:i:s \M\T, l F j, Y"));

print("</P>\n");

?>

</BODY>

</HTML>

• Modify "date.php"