SlideShare a Scribd company logo
Web Engineering II
Instructor:Engr Muhsin Ali Shah
 Assignments (5%)
 Quizes (10%)
 Attendence (5%)
 Mid-Term (30%)
 Final-Term (50%)
Marks Distribution
Chapter 1
PHP originally stood for:
Personal Home Pages
PHP is now a recursive acronym that stands for:
PHP: Hypertext Preprocessor
 PHP. Three letters that together constitute the name of one of the
world’s most popular programming languages for Web
development, the PHP Hypertext Preprocessor. the language is
today in use on over twenty million Web sites and more than a third
of the world’s Web servers
Introduction to PHP
What is PHP
 PHP is a server-side scripting language, like ASP
 PHP scripts are executed on the server
 PHP supports many databases (MySQL, Informix,Oracle etc.
 PHP is open source and free to download
 PHP files many contain text, HTML tags and scripts
 PHP files are returned to the browser as plain HTML
 PHP supports many databases (MySQL, Informix,Oracle etc.
 PHP files have extension of “.php”, “.php3” or “.phtml”
History
 PHP is a language for creating interactive web sites.
 It was originally called "Personal Home Page Tools"
when it was created in 1994 by Rasmus Lerdorf to keep
track of who was looking at his online CV.
 Mid-1997: students Andi Gutmans and Zeev Suraski
redesigned the PHP language engine and wrote some of
the most popular PHP modules.
 At that time PHP already had its own site, php.net,
run by the computer science community, and was powering
thousands of Web sites.
.
These Dates are recent…
 Version 0.0: Conceived in autumn of 1994.
 Version 1.0: Personal Home Page Tools in early 1995.
 Version 2.0: PHP/FI 1995-1997.
 Version 3.0: PHP 1997-2000.
 Version 4.0: PHP mid-2000.
 Version 4.1: 10 Dec 2001.
 Version 4.2: 22 Apr 2002.
 Version 5.0: 26 February 2009.
.
Unique Features
If you’re familiar with other server-side languages like ASP.NET or JSP,
you might be wondering what makes PHP so special, or so different
from these competing alternatives. Well, here are some reasons:
Performance
 Scripts written in PHP execute faster than those written in other scripting
languages, with numerous independent benchmarks putting the language
ahead of competing alternatives like JSP, ASP.NET, and Perl.
The PHP 5.0 engine was completely redesigned with an optimized
memory manager to improve performance, and is noticeably faster
than previous versions.
.
Unique Features
Portability
 PHP is available for UNIX, Microsoft Windows, Mac OS, and OS/2, and
PHP programs are portable between platforms. As a result, a PHP
application developed on, say, Windows will typically run on UNIX without
any significant issues.
Ease of Use
 Its syntax is clear and consistent, and it comes with exhaustive
documentation for the 5000+ functions included with the core
distributions.
Open Source
 PHP is an open-source project—the language is developed by a
worldwide team of volunteers who make its source code freely
available on the Web, and it may be used without payment of
licensing fees or investments in expensive hardware or software.
Unique Features
Third-Party Application Support
 One of PHP’s strengths has historically been its support for a wide
range of different databases, including MySQL, PostgreSQL,
Oracle, and Microsoft SQL Server. PHP 5.3 supports more than
fifteen different database engines, and it includes a common API for
database access.
 Q: Do I need to compile PHP programs before executing them,
as in Java or C++?
 No, because PHP is an interpreted language. One advantage of an
interpreted language is that it allows you to make changes to your
source code and immediately test these changes, without first
needing to compile your source code into binary form. Skipping the
compilation step makes the development process much faster, and
PHP comes with built-in memory management.
What you need for PHP?
 Install an Apache Server (web server) on a windows or
Linux machine
 Install PHP (server side scripting technlogy) on a
windows or Linux machine
 Install MySQL (database server) on a windows or Linux
machine
 And lots of Configuration work!!! 􀀯
 Alternatively, Just download WAMP Server and install
 It will not only installs Apache, MySQL and PHP on windows
machine but will also configure these softwares.
 Provides you an easy to access interface to run and host
PHP files.
PHP is C++ Style
 PHP is very similar to C++.
 This is because C++ is top banana.
 As a consequence if you know java (also a c++ ), C++ or
indeed almost any other computer science language you pretty
much already know PHP.
 However more than anything PHP is based on Perl.
PHP Tag Styles
 XML Style:
<?php
print “this is XML style”;
?>
 Short Style:
<?
print “this is ASP style”;
?>
Basic Development Concepts
 When developing a PHP application for the Web, the typical
approach is to embed PHP code into one or more standard HTML
documents using special “tags,” or delimiters.
<html>
<head></head>
<body>
<div>
<?php echo sqrt(49); ?>
</div>
</body>
</html>
Basic Development Concepts
 When such document is requested by a user,a PHP aware Web
Server can recognize and execute the php code blocks and
interpolate the resulting output into html document before returning
it to the requesting user.
Writing and Running the Script
 PHP scripts are merely plain-text files containing PHP instructions,
sometimes combined with other odds and ends—JavaScript,
HTML, and so on. So, the simplest way to write a PHP script is to
pop open your favorite text editor and create a file containing some
PHP code, as follows:
<?php
// this line of code displays a famous quotation
echo 'A horse! A horse! My kingdom for a horse!';
?>
Writing and Running the Script
 Save this file to a location under your Web server’s document root,
and name it horse.php. Then, start up your Web browser, and
browse to the URL corresponding to the file location. You should
see something like Figure.
Comments
 Why do we go on about comments so much?
 You can any of the following comment style in php.
 <?
// C style comment
# Perl style comment
/*
C++ multi line comment
*/
?>
Escaping Special Characters
 PHP allows you to escape certain characters by preceding them
with a backslash (). There so-called escape sequences include
Sequence What It Represents
n a line feed character
t a tab
r a carriage return
" a double quotation mark
' a single quotation mark
Difference between echo and print
Echo Print
1)can output one or more
strings
1)can only output one
string, and returns always 1
2)echo can take more than
one parameter when used
without parentheses.
2)print only takes one
parameter.
3)In PHP, echo is not a
function but a language
construct.
3)In PHP, print is not a
really function but a
language construct.
However, it behaves like a
function in that it returns a
value.

More Related Content

PPTX
Introduction to Spring Framework
PDF
Presentation joomla-introduction
PDF
Laravel Introduction
PPT
Xml parsers
PDF
Spring Framework - AOP
PPTX
Waf bypassing Techniques
PPT
Introduction To PHP
PPT
Jsp ppt
Introduction to Spring Framework
Presentation joomla-introduction
Laravel Introduction
Xml parsers
Spring Framework - AOP
Waf bypassing Techniques
Introduction To PHP
Jsp ppt

What's hot (20)

PPTX
Web programming
PDF
Spring Framework - Core
PDF
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
PPT
Chapter 02 php basic syntax
PDF
DVGA writeup
PPTX
Introduction to ajax
PPT
Php Presentation
PPTX
Laravel overview
PPT
Asynchronous JavaScript & XML (AJAX)
PDF
Spring boot
PPTX
Introduction to spring boot
PPT
Node.js Express Framework
PPTX
Web technologies: HTTP
PPTX
The World of PHP PSR Standards
PPTX
Spring boot Introduction
PDF
Learn Java with Dr. Rifat Shahriyar
PPTX
Web forms in ASP.net
PDF
Introduction to php
PPT
Web servers
Web programming
Spring Framework - Core
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Chapter 02 php basic syntax
DVGA writeup
Introduction to ajax
Php Presentation
Laravel overview
Asynchronous JavaScript & XML (AJAX)
Spring boot
Introduction to spring boot
Node.js Express Framework
Web technologies: HTTP
The World of PHP PSR Standards
Spring boot Introduction
Learn Java with Dr. Rifat Shahriyar
Web forms in ASP.net
Introduction to php
Web servers
Ad

Similar to PHP LICTURES .......... (20)

PPTX
PHP ITCS 323
PDF
PPTX
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
PPTX
Php intro
PDF
Summer training report priyanka
PPT
Php unit i
PPTX
Introduction to PHP from Beginning to End
PPT
DOCX
PHP.docx
PPT
Php Tutorial
PDF
PPT
PHP - Introduction to PHP Fundamentals
PPTX
Php unit i
PPTX
Introduction to PHP and mysql BSIT SSC project
PPTX
Unit 5-PHP Declaring variables, data types, array, string, operators, Expres...
PPT
Php hypertext pre-processor
PPTX
PHP Hypertext Preprocessor
PPT
Intro to PHP for Students and professionals
PPTX
Web Application Development using PHP Chapter 1
PPT
introduction to php notes for engineering students.ppt
PHP ITCS 323
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
Php intro
Summer training report priyanka
Php unit i
Introduction to PHP from Beginning to End
PHP.docx
Php Tutorial
PHP - Introduction to PHP Fundamentals
Php unit i
Introduction to PHP and mysql BSIT SSC project
Unit 5-PHP Declaring variables, data types, array, string, operators, Expres...
Php hypertext pre-processor
PHP Hypertext Preprocessor
Intro to PHP for Students and professionals
Web Application Development using PHP Chapter 1
introduction to php notes for engineering students.ppt
Ad

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PPTX
Introduction to Artificial Intelligence
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
System and Network Administraation Chapter 3
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
medical staffing services at VALiNTRY
PPTX
Transform Your Business with a Software ERP System
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
top salesforce developer skills in 2025.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
System and Network Administration Chapter 2
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
AI in Product Development-omnex systems
PPTX
Operating system designcfffgfgggggggvggggggggg
L1 - Introduction to python Backend.pptx
Introduction to Artificial Intelligence
Softaken Excel to vCard Converter Software.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
System and Network Administraation Chapter 3
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
medical staffing services at VALiNTRY
Transform Your Business with a Software ERP System
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PTS Company Brochure 2025 (1).pdf.......
top salesforce developer skills in 2025.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
Odoo POS Development Services by CandidRoot Solutions
System and Network Administration Chapter 2
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
VVF-Customer-Presentation2025-Ver1.9.pptx
Upgrade and Innovation Strategies for SAP ERP Customers
AI in Product Development-omnex systems
Operating system designcfffgfgggggggvggggggggg

PHP LICTURES ..........

  • 2.  Assignments (5%)  Quizes (10%)  Attendence (5%)  Mid-Term (30%)  Final-Term (50%) Marks Distribution
  • 4. PHP originally stood for: Personal Home Pages PHP is now a recursive acronym that stands for: PHP: Hypertext Preprocessor  PHP. Three letters that together constitute the name of one of the world’s most popular programming languages for Web development, the PHP Hypertext Preprocessor. the language is today in use on over twenty million Web sites and more than a third of the world’s Web servers Introduction to PHP
  • 5. What is PHP  PHP is a server-side scripting language, like ASP  PHP scripts are executed on the server  PHP supports many databases (MySQL, Informix,Oracle etc.  PHP is open source and free to download  PHP files many contain text, HTML tags and scripts  PHP files are returned to the browser as plain HTML  PHP supports many databases (MySQL, Informix,Oracle etc.  PHP files have extension of “.php”, “.php3” or “.phtml”
  • 6. History  PHP is a language for creating interactive web sites.  It was originally called "Personal Home Page Tools" when it was created in 1994 by Rasmus Lerdorf to keep track of who was looking at his online CV.  Mid-1997: students Andi Gutmans and Zeev Suraski redesigned the PHP language engine and wrote some of the most popular PHP modules.  At that time PHP already had its own site, php.net, run by the computer science community, and was powering thousands of Web sites. .
  • 7. These Dates are recent…  Version 0.0: Conceived in autumn of 1994.  Version 1.0: Personal Home Page Tools in early 1995.  Version 2.0: PHP/FI 1995-1997.  Version 3.0: PHP 1997-2000.  Version 4.0: PHP mid-2000.  Version 4.1: 10 Dec 2001.  Version 4.2: 22 Apr 2002.  Version 5.0: 26 February 2009. .
  • 8. Unique Features If you’re familiar with other server-side languages like ASP.NET or JSP, you might be wondering what makes PHP so special, or so different from these competing alternatives. Well, here are some reasons: Performance  Scripts written in PHP execute faster than those written in other scripting languages, with numerous independent benchmarks putting the language ahead of competing alternatives like JSP, ASP.NET, and Perl. The PHP 5.0 engine was completely redesigned with an optimized memory manager to improve performance, and is noticeably faster than previous versions. .
  • 9. Unique Features Portability  PHP is available for UNIX, Microsoft Windows, Mac OS, and OS/2, and PHP programs are portable between platforms. As a result, a PHP application developed on, say, Windows will typically run on UNIX without any significant issues. Ease of Use  Its syntax is clear and consistent, and it comes with exhaustive documentation for the 5000+ functions included with the core distributions. Open Source  PHP is an open-source project—the language is developed by a worldwide team of volunteers who make its source code freely available on the Web, and it may be used without payment of licensing fees or investments in expensive hardware or software.
  • 10. Unique Features Third-Party Application Support  One of PHP’s strengths has historically been its support for a wide range of different databases, including MySQL, PostgreSQL, Oracle, and Microsoft SQL Server. PHP 5.3 supports more than fifteen different database engines, and it includes a common API for database access.  Q: Do I need to compile PHP programs before executing them, as in Java or C++?  No, because PHP is an interpreted language. One advantage of an interpreted language is that it allows you to make changes to your source code and immediately test these changes, without first needing to compile your source code into binary form. Skipping the compilation step makes the development process much faster, and PHP comes with built-in memory management.
  • 11. What you need for PHP?  Install an Apache Server (web server) on a windows or Linux machine  Install PHP (server side scripting technlogy) on a windows or Linux machine  Install MySQL (database server) on a windows or Linux machine  And lots of Configuration work!!! 􀀯  Alternatively, Just download WAMP Server and install  It will not only installs Apache, MySQL and PHP on windows machine but will also configure these softwares.  Provides you an easy to access interface to run and host PHP files.
  • 12. PHP is C++ Style  PHP is very similar to C++.  This is because C++ is top banana.  As a consequence if you know java (also a c++ ), C++ or indeed almost any other computer science language you pretty much already know PHP.  However more than anything PHP is based on Perl.
  • 13. PHP Tag Styles  XML Style: <?php print “this is XML style”; ?>  Short Style: <? print “this is ASP style”; ?>
  • 14. Basic Development Concepts  When developing a PHP application for the Web, the typical approach is to embed PHP code into one or more standard HTML documents using special “tags,” or delimiters. <html> <head></head> <body> <div> <?php echo sqrt(49); ?> </div> </body> </html>
  • 15. Basic Development Concepts  When such document is requested by a user,a PHP aware Web Server can recognize and execute the php code blocks and interpolate the resulting output into html document before returning it to the requesting user.
  • 16. Writing and Running the Script  PHP scripts are merely plain-text files containing PHP instructions, sometimes combined with other odds and ends—JavaScript, HTML, and so on. So, the simplest way to write a PHP script is to pop open your favorite text editor and create a file containing some PHP code, as follows: <?php // this line of code displays a famous quotation echo 'A horse! A horse! My kingdom for a horse!'; ?>
  • 17. Writing and Running the Script  Save this file to a location under your Web server’s document root, and name it horse.php. Then, start up your Web browser, and browse to the URL corresponding to the file location. You should see something like Figure.
  • 18. Comments  Why do we go on about comments so much?  You can any of the following comment style in php.  <? // C style comment # Perl style comment /* C++ multi line comment */ ?>
  • 19. Escaping Special Characters  PHP allows you to escape certain characters by preceding them with a backslash (). There so-called escape sequences include Sequence What It Represents n a line feed character t a tab r a carriage return " a double quotation mark ' a single quotation mark
  • 20. Difference between echo and print Echo Print 1)can output one or more strings 1)can only output one string, and returns always 1 2)echo can take more than one parameter when used without parentheses. 2)print only takes one parameter. 3)In PHP, echo is not a function but a language construct. 3)In PHP, print is not a really function but a language construct. However, it behaves like a function in that it returns a value.