Presentation is loading. Please wait.

Presentation is loading. Please wait.

And Why You Should Use It In You Websites

Similar presentations


Presentation on theme: "And Why You Should Use It In You Websites"— Presentation transcript:

1 And Why You Should Use It In You Websites
A Look At PHP And Why You Should Use It In You Websites Hello Going to talk about 1. the history of PHP 2. some reasons to use PHP 3. a quick introduction into programming in PHP. 4. a more complex example of what you can do with PHP. 5. the possibilities of PHP

2 PHP/FI Created by Rasmus Lerdorf in 1995
Set of Perl scripts for tracking access to his online resume Named the scripts ‘Personal Home Page Tools‘ Release the source code, so that anybody can use it, and improve the code PHP/FI was created by Rasmus Lerdorf in 1995. Simple set of Perl scripts for tracking accesses to his online resume. Named the scripts 'Personal Home Page Tools'. When he needed to do more with it, he wrote a much larger C version. Was able to talk with databases. Enabled users to develop simple dynamic Web applications. Release the source code, so that anybody can use it, and improve the code.

3 PHP/FI 2.0 Officially released only in November 1997
Had a cult of followers Installed on 1% of the domains on the Internet PHP/FI 2.0 was officially released only in November 1997. After spending most of its life in beta releases. Had a cult of several thousand users around the world. Approximately 50,000 domains reporting as having it installed. 1% of the domains on the Internet at the time.

4 PHP 3.0 Was created by Andi Gutmans and Zeev Suraski in 1997
At its peak was installed on 10% of web servers around the world PHP 3.0 was created by Andi Gutmans and Zeev Suraski in 1997 Was a complete rewrite, after they found PHP/FI 2.0 severely underpowered for developing an application they were working on. In an effort build upon PHP/FI's existing user-base, the three creators decided to work together and announce PHP 3.0 as the official successor of PHP/FI 2, development of PHP/FI 2.0 was mostly halted. The whole new language was released under a new name, that removed the implication of limited personal use that the PHP/FI 2.0 name held. It was named 'PHP', meaning being a recursive acronym - PHP: Hypertext Preprocessor. By the end of 1998, PHP was installed on hundreds of thousands of Web sites. At its peak, PHP 3.0 was installed on approximately 10% of the Web servers on the Internet.

5 PHP 4 Officially released in May 2000 Powered by the ‘Zend Engine’
HTTP sessions output buffering More secure ways of handling user input Still in use today By 1998, shortly after PHP 3.0 was officially released, Andi and Zeev had begun working on a rewrite of PHP's core. The goals were to improve performance of complex applications, and improve the modularity of PHP's code base. While these applications were made possible in PHP 3. it was not designed to handle such complex applications efficiently. The new engine, dubbed 'Zend Engine' (comprised of their first names, Zeev and Andi), met these design goals successfully, and was first introduced in mid 1999. PHP 4, was officially released in May 2000, two years after its predecessor, it included features such as support for more Web servers, HTTP sessions, output buffering, more secure ways of handling user input.

6 PHP 5 Is the current version 20% of the worlds domains have installed
Released July 2004 Powered by Zend Engine 2.0 The current version of PHP is PHP 5. Several million sites report as having it installed, which accounts for over 20% of the domains on the Internet. PHP 5 was released in July 2004 after long development and several pre-releases run by the Zend Engine 2.0 with a new object model and dozens of other new features.

7 Reasons To Use Works well with HTML Interactive Features Easy to learn
There are many reasons to use PHP and some of the main reasons are; Works well with HTML. If you already have a website or know HTML you can start adding PHP to your pages easy. PHP is designed to be implemented with HTML. Interactive Features. PHP allows you to interact with you visitors in ways that pure HTML pages are just unable to. Things like forms, or more elaborate things like shopping carts that save your past orders and recommend similar products are some examples. Easy to learn. A lot easier to get started with then most people think. As long as you have some knowledge of HTML, once you learn a few simple functions you will be able to do a lot of things with your website. As well there are tens of thousands of scripts and forums for you to get help with your scripts.

8 One More Reason <HTML> <HEAD> some code here....
<BODY> </BODY> </HTML> There are plenty of more reasons to use PHP these are just a few of them. One more reason is that PHP can make programming a website faster and take less time than if you code everything in HTML. For example ever HTML page requires the code on the slide. Which you would have to type each time you create a page. Now with PHP you can actually write this just once instead of the 10 to 100 times for each page of your site. And where it says some code here you can add PHP code to fill in the details of this page.

9 The First Step <?php echo(‘hello world’); ?>
Now I’m going to teach you a little bit of PHP. This is the simplest PHP program out there, any tutorial or book you get will get you to do this for your first PHP program. Now lets dissect the program <?php is the opening tag just like the opening tag to all HTML tags. This goes before any PHP code you write. echo( ) this next part and is a built in function in PHP that simply prints to the screen anything that is between the ( ). The last character closes the bit of code and tells the PHP that it’s time to move onto the next thing. The last line is the closing tag of a PHP program. Its like the closing tags of HTML but instead of open brack slash tag name closing brack it simply closes with a

10 Something Just A Tad Harder
<?php $page = ($a != '' and $a != 'index') ? $a : 'home'; if(file_exists("content/$page.php")){ include("content/$page.php"); }else{ include('content/errors/404.php'); } ?> Now for something harder and this is actually something I use in alot of my site This function does a few things actually, so ill start from the beginning. First it creates a variable to hole the value of $a, but if there is no $a then it holds the value of ‘home’. Next it checks to see if a file exists and if it does it adds the contents of the file to the current file. But if it doesn’t if includes the contents of the 404.php file.

11 Requirements Third party software
Server to host your files with the software. Sadly unlike regular HTML which can be displayed locally on your machine. PHP does have some requirements before you can view it. It is possible to view it locally by installing third party such as XAMPP which is a program made by a company called Apache Friends. But its usually better hiring server space from a website host with it installed already for you.

12 Possibilities eCommerce Forums Contact Forms User sections Newsletters
Organising your folder structure With PHP you can let your skill and imagination run. You are really only limited to what you can think of. But you will still need to do your own shopping.

13 Final Thoughts Now to finish up.
This isn’t the only server side code out there in the world. But it does have some advantages over others. One its free. Two it has a wonderful set of resources to find help with your applications. Three once you get to know it what you can do with PHP is insane.


Download ppt "And Why You Should Use It In You Websites"

Similar presentations


Ads by Google