Presentation is loading. Please wait.

Presentation is loading. Please wait.

PHP HYPERTEXT: PREPROCESSOR By: Justin T. Pleva. WHAT IS PHP?  General purpose  Server-side web development  Console application.

Similar presentations


Presentation on theme: "PHP HYPERTEXT: PREPROCESSOR By: Justin T. Pleva. WHAT IS PHP?  General purpose  Server-side web development  Console application."— Presentation transcript:

1 PHP HYPERTEXT: PREPROCESSOR By: Justin T. Pleva

2 WHAT IS PHP?  General purpose  Server-side web development  Console application

3 BACKGROUND  First created in 1994 by Rasmus Lerdorf  Designed to streamline web tasks  Designed to access databases for storing data.  Used for web forms  First public release in 1995

4 BACKGROUND  Used primarily as website scripting  Text Interpreter/filter  Installed on over 20 million websites and domains  Can install multiple versions  Current version 5.4  Object-Oriented

5 HISTORY  Originally named “Personal Homepage Tools”  Rewritten in 1997 using C, released publicly  Renamed to “Hypertext Preprocessor”  Version 4 introduced command line functionality  Version 5 rewrote Object support  Version 6 has been postponed

6 LICENSING  Open source  PHP License  Term “PHP” cannot be used directly in a project.

7 OPERATING ENVIRONMENTS  Windows  Mac  Linux  Almost any others  Built from source  Web servers  Apache  IIS  Lighttpd

8 STACKS  Comes bundled with many Linux Distributions  Bundles for  Mac: MAMP (Mac, Apache, MySQL, PHP)  Linux: LAMP (Linux, Apache, MySQL, PHP)  Windows: WAMP …

9 HOW IT WORKS  Client Request sent to Web server  Web server directs to PHP filter  PHP processes data and sends to web server  Web server sends back to client

10 SYNTAX  Similar to major programming languages  C  Java  Can be embedded inside other languages such as HTML

11 SYNTAX : DECLARATIONS  Declared PHP code with delimiters   ASP Style   Code is only executed between these delimiters

12 SYNTAX: VARIABLES  Loosely typed, unlike C/Java // Create an integer and set equal to 3 $myVariable = 3; Prefixed name with ‘$’ Notice no type specified, this can be a string value of “3”, character ‘3’ or integer value of 3. Depends upon notation! Need to be careful with variable types!

13 SYNTAX: COMMENTING  Similar to other langues  // This is a single line comment  /* This is a block style comment */

14 SYNTAX: FUNCTIONS  Functions declarations similar to C/Java Function myFunction($value1, $value2) { return $value1 + $value2; } Can be value returning or not!

15 SYNTAX: LOOPS  Similar to C/Java  For … While … Do While … for each $i = 0; While ( $i != 5 ) { echo “Number is: “. $i. “ ; $i++; } Notice the ‘.’!

16 SYNTAX: FILE HANDLING  Can Open and write to file system  Used to read/write from a server for web content  Built in file support for:  XML  FTP  Zip  Cookies

17 SYNTAX: GET/POST  Can get data using $_Get[“ “]  Useful for retrieving data from url.  Can send data using $_Post[“ “]  Useful for submitting user forms such as request information forms.

18 SYNTAX: OBJECTS  PHP is Object-Oriented  Can create classes and objects of any type  Similar to C/Java  Can have private/public methods and data members  Arrow notation instead of dot notation

19 SYNTAX: MAIL  Built in Email support  Create text based email  Send via 1 function.

20 FILE EXTENSIONS  Standard extension:.php  Can have others .phtml .php5  If multiple versions are installed,.php5 will refer to version 5 installed

21 USAGE  Command line  Dynamic websites  Content Management  Can be used for Desktop applications  GUI controls

22 DATABASE SUPPORT  Built to work primarily with MySQL  Capable of working with others:  MS SQL  Oracle  Postgres  PDO Driver

23 SECURITY  Very little security holes have been found with core PHP application  Security risks come from each individual programmer, not the PHP filter!  Bad programming habits

24 WEB PRESENCE  20 Million domains/websites  Comes pre installed with many Linux distributions.  Content Management Systems

25 WEB PRESENCE: CMS  Many Content Management Systems are built with PHP  Joomla  Wordpress  Drupal  Far more built with PHP than others such as.Net

26 COMMUNITY SUPPORT  Need help? Google it.  Since PHP is so widely used, there is great community support  Content Management Systems are sometimes community built

27 SCRIPT AVAILABILITY  Community Support  Open Source  http://www.hotscripts.com http://www.hotscripts.com

28 DEVELOPMENT  Code in Notepad  IDE Support  Netbeans  Zend Studio  Eclipse  Codelobster

29 CONCLUSION  General Scripting lanaguage  Over 20 million domains  Command line/Web server-side  Various database support  Thousands of pre-built scripts  Open source

30 QUESTIONS?


Download ppt "PHP HYPERTEXT: PREPROCESSOR By: Justin T. Pleva. WHAT IS PHP?  General purpose  Server-side web development  Console application."

Similar presentations


Ads by Google