SlideShare a Scribd company logo
Presentation to
Siltek Software Solutions (I) Pvt. Ltd.
What is it?
 PHP is a scripting language commonly used on web
servers.
 Stands for “PHP: Hypertext Preprocessor”
 Open source
 Embedded code
 Comparable with ASP
 Multiple operating systems/web servers
More About PHP
 PHP is free software released under the PHP License.
 PHP typically runs on a web server that takes PHP as
input and gives out HTML pages as output.
 PHP is installed on more than 20 million websites and
1 million web servers.
 PHP has a syntax similar to C and Java.
 The current version of PHP is 5.2.x.
What can it do?
 Dynamic generation of web-page content
 Database interaction
 Processing of user supplied data
 Email
 File handling
 Text processing
 Network interaction
 And more…
Brief History of PHP
 PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in
1994. It was initially developed for HTTP usage logging and server-side
form generation in Unix.
 PHP 2 (1995) transformed the language into a Server-side 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
 As of August 2004, PHP is used on 16,946,328 Domains, 1,348,793 IP
Addresses http://www.php.net/usage.php This is roughly 32% of all
domains on the web.
Fundamentals
 PHP is embedded within xhtml pages within the tags:
<?php … ?>
 The short version of these tags can also be used: <? …
?>
 Each line of PHP is terminated, like MySQL, with a
semi-colon.
Hello World!
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo ‘<p>Hello World!</p>’; ?>
</body>
</html>
Features of PHP
 Performance
 Relatively fast for an interpreted language.
 Database Connectivity
 Support for MySQL, Oracle, dbm, DB2, PostgreSQL
 Can connect to any database which provides an ODBC
driver (Open Database Connectivity Standard) – e.g. MS
Access.
Features of PHP
 Existing Libraries
 PHP was originally designed for web use – lots of
functions for common web-development tasks (e.g.
Sending email, XML parsing, etc.)
 Portability
 Supported on Windows, Mac OS X, other Unix-like
systems (e.g. Linux).
Features of PHP
 Object-Oriented Programming
 Similar syntax and features as C++ and Java –
inheritance, attribute visibility
(private, protected), abstract
classes/methods, constructors and destructors, etc.
 Popularity
 As a result, lots of documentation, books, and web
tutorials.
PHP Usage
 Server-Side Scripting Language
 Must have a web server and the PHP interpreter
installed.
 PHP interpreter processes pages before they are served
to clients.
PHP Usage
Accessing MySQL Using PHP
About MySQL
 GNU Free, open-source, multi-platform
 Implements the standard SQL language
 Relational DBMS
 Written in C and C++
 Uses MyISAM B-tree disk tables
 Uses in-memory hash tables for temporary tables
Building On MySQL
 What languages can we use for building an application on
MySQL?
 ODBC Connector
 JDBC Connector
 .NET Connector
 Web scripting languages
 PHP, ASP, JSP
Uses of PHP and MySQL
 Anything in a MySQL database can be viewed on a
webpage
 Any information which can be captured from a website can
be stored into a database
Connecting to MySQL from PHP
/* Connection */
$username = ‘user’; // username
$password = ’password'; // password
$webhost = 'localhost'; // host (localhost or something on a web
server)
$db = ’test'; // the database
$dbc = mysql_connect($webhost, $username, $password) or
die("<p>Could not connect: <i>" . mysql_error());
@mysql_select_db($db) or die("<p>Could not find database - $db -
<i>" . mysql_error() . "</i>");
MySQL is Built Into PHP
 There are function calls to connect to a MySQL
server, send SQL commands, and retrieve data from
the server
Application Structure
Lets Install
XAMPP – What’s the tool?
XAMPP (pronounced as ZAMP) is a small and light Apache
distribution containing the most common web
development technologies in a single package.
Acronym for:
X- Read as "cross", meaning cross-platform)
A-Apache HTTP Server
M-MySQL
P-PHP
P-Perl
Features of XAMPP
• Ideal tool for developing and testing applications in PHP &
MySQL.
• Takes less time than installing each of its components
separately.
• Multiple instances of XAMPP can exist on a single
computer.
• Allow website designers and programmers to test their
work on their own computers without any access to the
Internet
• XAMPP also provides support for creating and
manipulating databases in MySQL and SQLite among
others.
How to install ?
 Go to http://www.apachefriends.org/en/xampp.html
 Versions available for Linux, Windows, Solaris, Mac OS X
Steps for Installation
 http://wiki.fiforms.org/index.php/Installing_XAMPP
Types of XAMPP
 WAMP - Windows
 MAMP – Mac OS X
 SAMP - Solaris
 LAMP - LINUX
XAMPP Configuration
Starting :
• To start XAMPP simply call this command :
• You should now see something like this on your screen :
• If you get any error messages please take a look at the
Linux FAQ.
/opt/lampp/lampp start
Starting XAMPP 1.7.4...
LAMPP: Starting Apache...
LAMPP: Starting MySQL...
LAMPP started.
XAMPP Configuration
Stopping :
• To stop XAMPP simply call this command :
• You should now see something like this on your screen :
• XAMPP for Linux is now stopped.
Starting XAMPP 1.7.4...
LAMPP: Stopping Apache...
LAMPP: Stopping MySQL...
LAMPP stoped.
/opt/lampp/lampp stop
Recommended Texts for Learning PHP
 Larry Ullman’s books from the Visual Quickpro series
 PHP & MySQL for Dummies
 Beginning PHP 5 and MySQL: From Novice to
Professional by W. Jason Gilmore
 (This is more advanced and dense than the others, but
great to read once you’ve finished the easier books. One
of the best definition/description of object oriented
programming I’ve read)
Resources
 Apache
 Website: http://httpd.apache.org/
 Documentation: http://httpd.apache.org/docs/2.2/
 PHP
 Website: http://www.php.net/
 Documentation and language reference:
http://www.php.net/docs.php
 http://www.w3schools.com/php/default.asp
Resources
 Xampp
 Combines an Apache web server, PHP, and MySQL into
one simple installation service.
 Very little configuration required by the user to get an
initial system up and running.
 http://www.apachefriends.org/en/xampp.html
Introduction to php
Introduction to php

More Related Content

What's hot

Php forms
Php formsPhp forms
Php forms
Anne Lee
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
Nidhi mishra
 
Statements and Conditions in PHP
Statements and Conditions in PHPStatements and Conditions in PHP
Statements and Conditions in PHP
Maruf Abdullah (Rion)
 
Php technical presentation
Php technical presentationPhp technical presentation
Php technical presentation
dharmendra kumar dhakar
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
Vibrant Technologies & Computers
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
Vineet Kumar Saini
 
Php
PhpPhp
Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)Arjun Shanka
 
Loops PHP 04
Loops PHP 04Loops PHP 04
Loops PHP 04
Spy Seat
 
Oops in PHP
Oops in PHPOops in PHP
Oops in PHP
Mindfire Solutions
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
Taha Malampatti
 
Javascript
JavascriptJavascript
Javascript
Manav Prasad
 
PHP POWERPOINT SLIDES
PHP POWERPOINT SLIDESPHP POWERPOINT SLIDES
PHP POWERPOINT SLIDES
Ismail Mukiibi
 
PHP Loops and PHP Forms
PHP  Loops and PHP FormsPHP  Loops and PHP Forms
PHP Loops and PHP Forms
M.Zalmai Rahmani
 

What's hot (20)

Php introduction
Php introductionPhp introduction
Php introduction
 
Php forms
Php formsPhp forms
Php forms
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Statements and Conditions in PHP
Statements and Conditions in PHPStatements and Conditions in PHP
Statements and Conditions in PHP
 
Arrays in PHP
Arrays in PHPArrays in PHP
Arrays in PHP
 
Php technical presentation
Php technical presentationPhp technical presentation
Php technical presentation
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
 
Php
PhpPhp
Php
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
Php
PhpPhp
Php
 
PHP slides
PHP slidesPHP slides
PHP slides
 
Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)
 
Loops PHP 04
Loops PHP 04Loops PHP 04
Loops PHP 04
 
Oops in PHP
Oops in PHPOops in PHP
Oops in PHP
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
 
Javascript
JavascriptJavascript
Javascript
 
PHP POWERPOINT SLIDES
PHP POWERPOINT SLIDESPHP POWERPOINT SLIDES
PHP POWERPOINT SLIDES
 
PHP Loops and PHP Forms
PHP  Loops and PHP FormsPHP  Loops and PHP Forms
PHP Loops and PHP Forms
 

Similar to Introduction to php

PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
bmani
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
Sleepy Head
 
PHP
PHPPHP
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
PHP LICTURES ..........
PHP LICTURES ..........PHP LICTURES ..........
PHP LICTURES ..........
Rashid Ahmad
 
Why to use PHP
Why to use PHPWhy to use PHP
Why to use PHPsammesh30
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
adeel990
 
Php unit i
Php unit i Php unit i
Php unit i
prakashvs7
 
Web technologies lesson 1
Web technologies   lesson 1Web technologies   lesson 1
Web technologies lesson 1nhepner
 
Create dynamic sites with PHP & MySQL
Create dynamic sites with PHP & MySQLCreate dynamic sites with PHP & MySQL
Create dynamic sites with PHP & MySQLkangaro10a
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
jphl
 
Training ppt
Training pptTraining ppt
Training ppt
nikita vijay
 
Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processorSiddique Ibrahim
 
Php introduction and configuration
Php introduction and configurationPhp introduction and configuration
Php introduction and configuration
Vijay Kumar Verma
 

Similar to Introduction to php (20)

Lamp
LampLamp
Lamp
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
PHP
PHPPHP
PHP
 
php basics
php basicsphp basics
php basics
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
PHP LICTURES ..........
PHP LICTURES ..........PHP LICTURES ..........
PHP LICTURES ..........
 
Why to use PHP
Why to use PHPWhy to use PHP
Why to use PHP
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
 
Php unit i
Php unit i Php unit i
Php unit i
 
Web technologies lesson 1
Web technologies   lesson 1Web technologies   lesson 1
Web technologies lesson 1
 
Create dynamic sites with PHP & MySQL
Create dynamic sites with PHP & MySQLCreate dynamic sites with PHP & MySQL
Create dynamic sites with PHP & MySQL
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
 
Training ppt
Training pptTraining ppt
Training ppt
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processor
 
Php introduction and configuration
Php introduction and configurationPhp introduction and configuration
Php introduction and configuration
 
Php
PhpPhp
Php
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

Introduction to php

  • 1. Presentation to Siltek Software Solutions (I) Pvt. Ltd.
  • 2. What is it?  PHP is a scripting language commonly used on web servers.  Stands for “PHP: Hypertext Preprocessor”  Open source  Embedded code  Comparable with ASP  Multiple operating systems/web servers
  • 3. More About PHP  PHP is free software released under the PHP License.  PHP typically runs on a web server that takes PHP as input and gives out HTML pages as output.  PHP is installed on more than 20 million websites and 1 million web servers.  PHP has a syntax similar to C and Java.  The current version of PHP is 5.2.x.
  • 4. What can it do?  Dynamic generation of web-page content  Database interaction  Processing of user supplied data  Email  File handling  Text processing  Network interaction  And more…
  • 5. Brief History of PHP  PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was initially developed for HTTP usage logging and server-side form generation in Unix.  PHP 2 (1995) transformed the language into a Server-side 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 .
  • 6. 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  As of August 2004, PHP is used on 16,946,328 Domains, 1,348,793 IP Addresses http://www.php.net/usage.php This is roughly 32% of all domains on the web.
  • 7. Fundamentals  PHP is embedded within xhtml pages within the tags: <?php … ?>  The short version of these tags can also be used: <? … ?>  Each line of PHP is terminated, like MySQL, with a semi-colon.
  • 8. Hello World! <html> <head> <title>PHP Test</title> </head> <body> <?php echo ‘<p>Hello World!</p>’; ?> </body> </html>
  • 9. Features of PHP  Performance  Relatively fast for an interpreted language.  Database Connectivity  Support for MySQL, Oracle, dbm, DB2, PostgreSQL  Can connect to any database which provides an ODBC driver (Open Database Connectivity Standard) – e.g. MS Access.
  • 10. Features of PHP  Existing Libraries  PHP was originally designed for web use – lots of functions for common web-development tasks (e.g. Sending email, XML parsing, etc.)  Portability  Supported on Windows, Mac OS X, other Unix-like systems (e.g. Linux).
  • 11. Features of PHP  Object-Oriented Programming  Similar syntax and features as C++ and Java – inheritance, attribute visibility (private, protected), abstract classes/methods, constructors and destructors, etc.  Popularity  As a result, lots of documentation, books, and web tutorials.
  • 12. PHP Usage  Server-Side Scripting Language  Must have a web server and the PHP interpreter installed.  PHP interpreter processes pages before they are served to clients.
  • 15. About MySQL  GNU Free, open-source, multi-platform  Implements the standard SQL language  Relational DBMS  Written in C and C++  Uses MyISAM B-tree disk tables  Uses in-memory hash tables for temporary tables
  • 16. Building On MySQL  What languages can we use for building an application on MySQL?  ODBC Connector  JDBC Connector  .NET Connector  Web scripting languages  PHP, ASP, JSP
  • 17. Uses of PHP and MySQL  Anything in a MySQL database can be viewed on a webpage  Any information which can be captured from a website can be stored into a database
  • 18. Connecting to MySQL from PHP /* Connection */ $username = ‘user’; // username $password = ’password'; // password $webhost = 'localhost'; // host (localhost or something on a web server) $db = ’test'; // the database $dbc = mysql_connect($webhost, $username, $password) or die("<p>Could not connect: <i>" . mysql_error()); @mysql_select_db($db) or die("<p>Could not find database - $db - <i>" . mysql_error() . "</i>");
  • 19. MySQL is Built Into PHP  There are function calls to connect to a MySQL server, send SQL commands, and retrieve data from the server
  • 22. XAMPP – What’s the tool? XAMPP (pronounced as ZAMP) is a small and light Apache distribution containing the most common web development technologies in a single package. Acronym for: X- Read as "cross", meaning cross-platform) A-Apache HTTP Server M-MySQL P-PHP P-Perl
  • 23. Features of XAMPP • Ideal tool for developing and testing applications in PHP & MySQL. • Takes less time than installing each of its components separately. • Multiple instances of XAMPP can exist on a single computer. • Allow website designers and programmers to test their work on their own computers without any access to the Internet • XAMPP also provides support for creating and manipulating databases in MySQL and SQLite among others.
  • 24. How to install ?  Go to http://www.apachefriends.org/en/xampp.html  Versions available for Linux, Windows, Solaris, Mac OS X
  • 25. Steps for Installation  http://wiki.fiforms.org/index.php/Installing_XAMPP
  • 26. Types of XAMPP  WAMP - Windows  MAMP – Mac OS X  SAMP - Solaris  LAMP - LINUX
  • 27. XAMPP Configuration Starting : • To start XAMPP simply call this command : • You should now see something like this on your screen : • If you get any error messages please take a look at the Linux FAQ. /opt/lampp/lampp start Starting XAMPP 1.7.4... LAMPP: Starting Apache... LAMPP: Starting MySQL... LAMPP started.
  • 28. XAMPP Configuration Stopping : • To stop XAMPP simply call this command : • You should now see something like this on your screen : • XAMPP for Linux is now stopped. Starting XAMPP 1.7.4... LAMPP: Stopping Apache... LAMPP: Stopping MySQL... LAMPP stoped. /opt/lampp/lampp stop
  • 29. Recommended Texts for Learning PHP  Larry Ullman’s books from the Visual Quickpro series  PHP & MySQL for Dummies  Beginning PHP 5 and MySQL: From Novice to Professional by W. Jason Gilmore  (This is more advanced and dense than the others, but great to read once you’ve finished the easier books. One of the best definition/description of object oriented programming I’ve read)
  • 30. Resources  Apache  Website: http://httpd.apache.org/  Documentation: http://httpd.apache.org/docs/2.2/  PHP  Website: http://www.php.net/  Documentation and language reference: http://www.php.net/docs.php  http://www.w3schools.com/php/default.asp
  • 31. Resources  Xampp  Combines an Apache web server, PHP, and MySQL into one simple installation service.  Very little configuration required by the user to get an initial system up and running.  http://www.apachefriends.org/en/xampp.html