Sie sind auf Seite 1von 39

IIMT COLLEGE OF ENGG. GR.

NOIDA

COLLOQUIUM M.C.A. TOPIC

PHP

PHP An Introduction

UNDER GUIDENCE :MR. PRABHAT SIR PERSENTED BY:BHOOPENDRA KUMAR MODANWAL

INTRODUCTION
1.Agenda 2.History 3.Why use php 4.Getting start 5.Advance PHP 6.PHP CMS 7.PHP Framework

AGENDA
1. Brief History of PHP
2.Getting Started

3.Advance PHP
4.PHP C.M.S.

5.PHP Framework

Brief History of PHP


PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorfin 1994. It was initially developed for HTTP usage logging and server-side form generation in Unix. PHP 2 (1995) transformed the language into a Serverside embedded scripting language. Added database support, file uploads, variables, arrays, recursive functions, conditionals, iteration, regular expressions, etc.

PHP 3 (1998) added support for ODBC data sources, multiple platform support, email protocols (SNMP,IMAP), and new parser written by Zeev Suraski and Andi Gutmans .

Brief History of PHP


PHP 4 (2000) became an independent component of the web server for added efficiency. The parser was renamed the Zend Engine. Many security features were added. PHP 5 (2004) adds Zend Engine II with object oriented programming, robust XML support using the libxml2 library, SOAP extension for interoperability with Web Services, SQLite has been bundled with PHP

Brief History of PHP


As of August 2004, PHP is used on 16,946,328 Domains, 1,348,793 IP Addresseshttp://www.php.net/usage.php This is roughly 32% of all domains on the web.

Why is PHP used?


1.Easy to UseCode is embedded into HTML. The PHP code is enclosedin special start and end tags that allow you to jump into and out of "PHP mode".
<html> <head> <title>Example</title> </head> <body>
<?php echo "Hi, I'm a PHP script!"; ?> </body> </html>

Why is PHP used?


2. Cross Platform Runs on almost any Web server on several operating systems. One of the strongest features is the wide range of supported databases Web Servers: Apache, Microsoft IIS, Caudium, Netscape Enterprise Server Operating Systems: UNIX (HP-UX,OpenBSD,Solaris,Linux), Mac OSX, Windows NT/98/2000/XP/2003

Supported Databases: Adabas D, dBase,Empress, FilePro (read-only), Hyperwave,IBM DB2, Informix, Ingres, InterBase, FrontBase, mSQL, Direct MS-SQL, MySQL, ODBC, Oracle (OCI7 and OCI8), Ovrimos, PostgreSQL, SQLite, Solid, Sybase, Velocis,Unix dbm

Why is PHP used?


3. Cost Benefits PHP is free. Open source code means that the entire PHP community will contribute towards bug fixes. There are several add-on technologies (libraries) for PHP that are also free.

Getting Started
How to escape from HTML and enter PHP modePHP parses a file by looking for one of the special tags that tells it to start interpreting the text as PHP code. The parser then executes all of the code it finds until it runs into a PHP closing tag. Simple HTML Page with PHPThe following is a basic example to output text using PHP.
<html><head> <title>My First PHP Page</title> </head> <body> <?php echo "Hello World!"; ?> </body></html>

Examples
PHP is a great way to implement templates on your website. How to implement a simple page counter

Examples
Step 1: Universal header and footer in a single file Step 2:Create a file called header.php. This file will have all of the header HTML code. You can use FrontPage/Dreamweaver to create the header, but remember to remove the closing </BODY> and </HTML> tags. Step 3: Universal header and footer in a single file This is the basic template that you will use on all of the pages. Make sure you name the files with a .php extension so that the server will process the PHP code. In this example, we assume the header and footer files are located in the same directory.

Examples
Benefits: - Any changes to header or footer only require editing of a single file. This reduces the amount of work necessary for site maintenance and redesign. - Helps separate the content and design for easier maintenance Header

Page 1 Content

Page 2 Content

Page 3 Content

Page 4 Content

Page 5 Content

Footer

Advance PHP
Advance PHP is basicaly devided into two part 1.which is based on CMS 2.which is based on frame work

What is CMS
The name CMS, Content System Management, is a vague term, since actually any software manages contents. More precisely one gives this name to a software which manages the creation and the publication of documents, possibly in a collaborative way. On this site, we will speak rather about CMS as Web applications, therefore software of assistance to put documents in line on Internet.

Why a CMS?
Content managers undertake the part common to the pages of your site and generates the pages starting from the text or of the data that you provide him. He thus delivers you repetitive tasks. He can be static and create the pages before they are put in lines, or dynamic and create the page at the request of the visitor. He does not bring anything about the contents itself, but makes it possible to manage the structure of the site, to add and classify the pages. The major CMS make it possible to manage a forum, a directory, news, most of the time by the addition of extensions. Sometimes it makes it possible to adapt the interface of the site, to generate more stripped printable pages or to make contributors taking part to the site.

Type of CMS

If we are taking about the CMS then it is more than 70 but some of CMS is given below

Ariadne ,ArtiVelocity,B2evolution, BlogCMS,Caravel,CMS, Chlorine,BoardsChronoSite,Cwiab,CMSimple, CMSMdeSimp, Coppermine CuteNews, DBHcms , DotClear ,DokuWiki, Drigg,Drupal,e107, GroupWare,Elgg,Exponent ,eZpublish , FluBB,Freeglobes,Geklog, GuppY, IntraLibre,Itseasy, Joomla!, lemon,CMS, Lodel,Mambo, MediaWiki, MidgardCS,Modx, NitroTech, NPDS, NucleusCMS, OpenPHPNuke, phpBB, Phorum,PHPMotion,PHPNuke, PhpdugPHPList, PhpMyFaq, phpWCMS

Type of CMS
phpWebSite, phpCMS, PhpWiki, Pivot Pligg,PmWiki, PortalPHP, Prestashop,SEOToaster,SilverStripe,SMF,Spip, Storytlr,Templeet, Textpattern,TikiWiki,Typo3 , Wikkawiki, Wordpress,Xaraya, Xoops,Zikula.

Top popular Type of CMS


1. 2. 3. 4. Joomla Drupal Wordpress FluxBB

Joomla Introduction
Introduction to the popular Joomla CMS (Content Management System) and its use. This strange name was chosen among many others! It is a Swahili word that expresses the community vision of the tool. Joomla uses are quite varied: portal, magazine, ecommerce. In April 2010, Microsoft has signed the Joomla! Contributor Agreement and now contributes to the code for it to work better on its Windows IIS server.

Advantages of Joomla (since version 1.5.9)


Upload images in the library. Display articles randomly selected to publicize the oldest content, besides more recent additions. Print format for each item. Sending emails to announce a new article. Insertion of a poll in each article (available on Drupal too). Banners manager. Custom look and feel selected by each user. Search field associated with a statistical research tool for the site. Syntax-hightlighting for code. Possibly assigning a different template for each page. Integrated Forum (Extension). Integrated FAQ (Extension).

Drawbacks of Joomla
Documentation is the weak point of this CMS. We do not even see on the site a list of features of the software, we must pick them up on other sites. Apart a PDF file somewhere on the site I found through Google. The wiki and more precisely the Absolute Beginners Guide to Joomla provides some information. Joomla has only two levels of hierarchy while Wordpress allows you to add sub-categories without limitation. That's enough for a site of entrerprises or ecommerce but Joomla is not suitable for a documentary website.

Drupal Introduction
Drupal is a content management system automated with which the user can simply write without worrying about categorization and other aspects of site management. But considered in this way, Drupal must be installed by an experienced webmaster, because the original setup is limited to basics, there is not even a menu of categories, and it is with the addition of modules that we will provide to a site all the features of the Web 2.0: tag cloud, display of recent articles, RSS feeds, statistics of visits, etc..

Advantages of drupal
The CCK is now part of the core software and is no longer a module. The Content Construction Kit allows to create new types of pages. Like Wordpress, you can upload images and make manipulations. The interface is simpler, more intuitive. A designer has been specially hired to redesign the interface. An update manager is added. Custom fields allow to extend the pages without creating new types. This comes from Wordpress. All databases may be used now as the software interacts with an interface layer. The Drupal Theme Garden is a repository of themes under the GPL, thus freely usable. Drupal 7 is faster due to improved access to the database.

Disadvantage of drupal
Drupal is compatible with the data but not with the code. A new version may require the webmaster or module developer to change the code he added to suit the new version. But they may still use the contents of the database. However, the code compatibility is maintained between minor versions.Drupal 7 becomes incompatible with Drupal 6, but Drupal 6.1, 6.2, 6.3 etc. remain consistent when the code of Drupal 6.0.

Wordpress Introduction
Wordpress is both a host of blogs, Wordpress.com with four million hosted blogs in 2008 There are other blogging software such as dotclear, but Wordpress, through its many contributors has a very broad range of plugins and themes that make it nearly universal and provides almost all the features that we could ask for. We can give it also a more general use, building even a platform for e-commerce. In addition it makes low use of resources and is optimized for SEO.

Advantage of Wordpress
1. Cheap or Free Using WordPress for your website means its cheap or free. WordPress itself is free, a theme is easily under $100 or even free and you save loads of money (compare the cost of template vs custom design). Havent you heard? Stingy is in. 2. Its That Easy If youve got any computer savvy, WordPress is easy to use. If you can send an e-mail, use Microsoft Word or set up a Facebook account, then you can use WordPress. And normal use doesnt run the risk of mucking up the design. Its website creation for non-techies. 3. Do It Yourself With WordPress you enter the Do-It-Yourself world. No more waiting for and paying a programmer to fix a tiny error, saving you time and money.

Advantage of Wordpress
4. Many Users, Many Places WordPress is online and offers multiple users, which means youre not the only one who can fix something in a pinch and you can access it from anywhere. Which means if youve got Internet access in Tahiti, you could work from there. That also means your important site is backed up on a secure server with multiple redundancies, not some high school kids laptop. 5. Climb the Search Results WordPress also makes it easier to optimize your search engine results. That means your site is more likely to land on the first page of Google results, which means people are more likely to find you.

Disadvantage of Wordpress
Many of the themes have a tendency to look the same or similar. PHPs track record for security is pretty bad. Database queries may be very heavy It isnt a full CMS product which is fine for a lot of sites but if your site is moving a long way away from something based around a blog then you might find it starts to creak a bit!

What is framework
The idea behind a framework is to offer a design you can use across multiple applications. All applications have a number of basic things in common. A framework is designed to provide a structure for those common elements (database interaction, presentation layer, application logic) so you spend less time writing up database interface code or presentation-layer interfaces and more time writing the application itself. The architecture represented by breaking an application up in this fashion is referred to as Model-View-Controller (MVC). Model refers to your data, View to your presentation layer, and Controller refers to the application or business logic.

Why a framework
There's a reason why PHP is growing rapidly as a server-side scripting language it's very easy to pick up. Many functions are included without needing any sort of namespace importing, and you don't even have to write OO code if you don't want to. Variables are weakly typed and the syntax is fairly familiar. But PHP's ease of use is also its downfall. Because there are less restrictions on the structure of the code you write, it's much easier to write bad code. But there is a solution: use a framework.

Type of framework
1.Cake PHP 2. Symfony PHP 3.Prado 4.Kohana 5.Codelgniter 6. Akelos 7.Zend Framework 8.Solar Framework

Type of framework
9 . Yii PHP Framework 10. Maintainable 11.Seagill 12.Fuse 13.Phoco 14.Limb 15.Zoop 16.Blue Shoes

Cake PHP
CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces developmental costs and helps developers write less code.

Zend Framework
The Zend Framework is an object-oriented framework written strictly in PHP 5. It'ssimple, easy to work with, and has a loose architecture that lets you use various Zend components to enhance your applications functionality.

Symfony PHP
The Symfony PHP Framework holds a library of various classes written in PHP 5. Architecture, useful components and excellent tools are provided for creating complex web apps.

Solar framework
Solar is a PHP 5 framework for web application development. It is fully namespaced and uses enterprise application design patterns, with built-in support for localization and configuration at all levels.

Das könnte Ihnen auch gefallen