the smartpath information systems php presentation

26
Powerpoint Templates Page 1 Powerpoint Templates Basics and uses of php Prepared By www.thesmartpath.in

Upload: the-smartpath-information-systemsbhilaidurgchhattisgarh

Post on 12-Jan-2017

220 views

Category:

Services


4 download

TRANSCRIPT

Page 1: The smartpath information systems  php presentation

Powerpoint Templates Page 1Powerpoint Templates

Basics and uses of php

Prepared By

www.thesmartpath.in

Page 2: The smartpath information systems  php presentation

Powerpoint Templates Page 2

Index

1. What is PHP  2. Features of PHP3. What PHP can do4. What is PHP file5. Versions of PHP – PHP 56. Versions of PHP – PHP 6 and Unicode7. Versions of PHP – PHP 78. Installing PHP9. PHP Syntax10. PHP variables11. PHP Comments12. PHP Variables

Page 3: The smartpath information systems  php presentation

Powerpoint Templates Page 3

Index

 12. Rules for declaring variables 13. PHP Variables Scope14. PHP – Data Types15. Uses of PHP - e commerce16. Uses of PHP - Project Management 17. Uses of PHP Desktop Application18. Uses of PHP - Web Templates19. Uses of PHP – Parsing XML Files20. PHP and MYSQL21. PHP and MYSQL (About MYSQL)

Page 4: The smartpath information systems  php presentation

Powerpoint Templates Page 4

What is php

  PHP is an acronym for "PHP: Hypertext Preprocessor“

PHP is a widely-used, open source scripting language

PHP scripts are executed on the server

PHP is free to download and use

Page 5: The smartpath information systems  php presentation

Powerpoint Templates Page 5

Features of php

1. PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)

2. PHP is compatible with almost all servers used today (Apache, IIS, etc.)

3. PHP supports a wide range of databases

4. PHP is free. Download it from the official PHP resource: www.php.net

5. PHP is easy to learn and runs efficiently on the server side

Page 6: The smartpath information systems  php presentation

Powerpoint Templates Page 6

What php can do

1. PHP can generate dynamic page content

2. PHP can create, open, read, write, delete, and close files on the server

3. PHP can collect form data

4. PHP can send and receive cookies

5. PHP can add, delete, modify data in your database

6. PHP can be used to control user-access

7. PHP can encrypt data

Page 7: The smartpath information systems  php presentation

Powerpoint Templates Page 7

What is php file

1. PHP files can contain text, HTML, CSS, JavaScript, and PHP code

2. PHP code are executed on the server, and the result is returned to the browser as plain HTML

3. PHP files have extension ".php”

Page 8: The smartpath information systems  php presentation

Powerpoint Templates Page 8

Versions of php – php 5

On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects (PDO) extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements. In 2008 PHP 5 became the only stable version under development. Late static binding had been missing from PHP and was added in version 5.3.Many high-profile open-source projects ceased to support PHP 4 in new code as of February 5, 2008, because of the GoPHP5 initiative provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5.

Page 9: The smartpath information systems  php presentation

Powerpoint Templates Page 9

Versions of php – php6

PHP 6 and UNICODE

PHP received mixed reviews due to lacking native Unicode support at the core language level. In 2005, a project headed by Andrei Zmievski was initiated to bring native Unicode support throughout PHP, by embedding the International Components for Unicode (ICU) library, and representing text strings as UTF-16 internally. Since this would cause major changes both to the internals of the language and to user code, it was planned to release this as version 6.0 of the language, along with other major features then in development.

Page 10: The smartpath information systems  php presentation

Powerpoint Templates Page 10

Versions of php – php 7

Php 7PHP 7 gets its foundations from an experimental PHP branch that was originally named phpng (PHP next generation), which aims at optimizing PHP performance by refactoring the Zend Engine while retaining near-complete language compatibility. As of 14 July 2014, WordPress-based benchmarks, which serve as the main benchmark suite for the phpng project, show an almost 100% increase in performance. Changes from phpng are also expected to make it easier to improve performance in the future, as more compact data structures and other changes are seen as better suited for a successful migration to a just-in-time (JIT) compiler. Because of the significant changes, this reworked Zend Engine will be called Zend Engine 3, succeeding the Zend Engine 2 used in PHP 5.

Page 11: The smartpath information systems  php presentation

Powerpoint Templates Page 11

Installing php

Set up php on your own pc

However, if your server does not support PHP, you must: install a web server install PHP

install a database, such as MySQL

Use web host with php support

If your server has activated support for php – a) create some .php files and place them in web directory server will b) automatically parse them for youBecause PHP is FREE most web hosts offer php support

Page 12: The smartpath information systems  php presentation

Powerpoint Templates Page 12

Php - Syntax

Basic php Syntax

Php script can bé placed anywhere in document

A php script starts with <?php and ends with ?> <?php

// php code Goes hère

?>The default file extension of PHP is « .php »A php file contains normally HTML tags and PHP script code

In PHP keywords such as(if- else echo, while etc) are NOT case sensitive

Page 13: The smartpath information systems  php presentation

Powerpoint Templates Page 13

Php - Comments

Comments in PHP

A comment in PHP code is a line that is not read/executed as part of the program. Its only purpose is to be read by someone who is looking at the code. Comments can be used to:

Let others understand what you are doing

Remind yourself of what you did - Most programmers have experienced coming back to their own work a year or two later and having to re-figure out what they did. Comments can remind you of what you were thinking when you wrote the code

Page 14: The smartpath information systems  php presentation

Powerpoint Templates Page 14

Php - variables

Php 5 variables

Creating (Declaring) PHP Variables : In PHP, a variable starts with the $ sign, followed by the name of the variable

Using PHP Variables

A variable can have a short name (like x and y) or

A more descriptive name (age, carname, total_volume).

Page 15: The smartpath information systems  php presentation

Powerpoint Templates Page 15

Rules for PHP declaring variables:

A variable starts with the $ sign, followed by the name of the variable

A variable name must start with a letter or the underscore character

A variable name cannot start with a number

A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )

Variable names are case-sensitive ($age and $AGE are two different variables)

Page 16: The smartpath information systems  php presentation

Powerpoint Templates Page 16

Php-variables Scope

Php 5 variables scope

In PHP, variables can be declared anywhere in the script. The scope of a variable is the part of the script where the variablecan be referenced/used.

PHP has three different variable scopes:

local global static

Page 17: The smartpath information systems  php presentation

Powerpoint Templates Page 17

Php – Data Types

Php 5 Data Types

PHP supports following data types : String Integer Float Boolean Array Object Resource

Page 18: The smartpath information systems  php presentation

Powerpoint Templates Page 18

Uses of php - e-commerce

1. E-commerce E-commerce is one of the major uses for PHP. From a small business level to an enterprise level, businesses are always looking to create additional streams of revenue online. If you know how to integrate existing e-commerce solutions or build your own from scratch, this gives you a distinct advantage with your clients.

Page 19: The smartpath information systems  php presentation

Powerpoint Templates Page 19

Uses of php – Project mangement

2. Project Management Tools For both freelancers and web development firms alike, project management is an important aspect of your business. Your clients need a resource to be able to check the progress of the work and provide feedback. Ideally, with a good project management system in place, your clients will be thoroughly pleased with the end result.

Page 20: The smartpath information systems  php presentation

Powerpoint Templates Page 20

Uses of php- Desktop applications

3. GUI Interface

For those of you who are up to the challenge, you can extend your PHP installation to create desktop applications. This one is a challenge because it requires some extensive knowledge of PHP and it might also be easier to create desktop applications in other programming languages. If PHP is your favorite programming language, then you can use some of these PHP extensions to get you started creating GUI applications.

PHP GTK - This extension is a popular open source that GIMP toolkit

ZZEE PHP GUI - A paid solution that allows you to turn your PHP scripts into windows applications.

Page 21: The smartpath information systems  php presentation

Powerpoint Templates Page 21

Uses of php-web templates

4. Creating dynamic website templates

Using PHP, you can make it easier to add pages and elements to your websites dynamically. You begin by creating the HTML page and splitting it into the header, main content, and footer sections. Add the .php extension to your subsequent pages and use server-side Includes for the header and footer for each new page. You can also have dynamic sidebars and top navigation sections. As a matter of fact, the more "templated" your site is, the easier it is to update the content.

Page 22: The smartpath information systems  php presentation

Powerpoint Templates Page 22

Uses of php - Parsing XML files

5. Parsing XML Files

PHP allows you to parse XML files. Parsing XML is an important feature of PHP 5 because not all browsers can output the contents of an XML file; so you can create a parser in PHP to facilitate this process. Using XML is important for RSS feeds, and also for data storage and rendering data on different devices - for example, cell phones use an implementation of XML called WML (Wireless Markup Language). Working with XML files in PHP is similar to handling the opening, closing, and reading of a file. The steps involved are creating an XML parser, setting functions to handle your opening and closing XML tags, opening the file for reading, reading the file incrementally and then closing it.

Page 23: The smartpath information systems  php presentation

Powerpoint Templates Page 23

Uses of php-parsing XML files

Page 24: The smartpath information systems  php presentation

Powerpoint Templates Page 24

Php and MYSQL

Php MySQL database With PHP, you can connect to and manipulate databases.MySQL is the most popular database system used with PHP.

The data in a MySQL database are stored in tables. A table is a collection of related data, and it consists of columns and rows.Databases are useful for storing information categorically.

Facts about MySQL database

MySQL is the de-facto standard database system for web sites with HUGE volumes of both data and end-users (like Facebook, Twitter, and Wikipedia).Another great thing about MySQL is that it can be scaled down to support embedded database applications.

Page 25: The smartpath information systems  php presentation

Powerpoint Templates Page 25

Php and MYSQLAbout MySQL MySQL is a database system used on the web

MySQL is a database system that runs on a server

MySQL is ideal for both small and large applications

MySQL is very fast, reliable, and easy to use

MySQL uses standard SQL

MySQL compiles on a number of platforms

MySQL is free to download and use

MySQL is developed, distributed, and supported by Oracle Corporation

Page 26: The smartpath information systems  php presentation

Powerpoint Templates Page 26